TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches

◆ RequestBuffRemoval()

void Terraria.NPC.RequestBuffRemoval ( int buffTypeToRemove)
inline

Removes the buff type and shuffles the remaining buff indexes down to fill the gap. Note that only buffs contained in F:Terraria.ID.BuffID.Sets.CanBeRemovedByNetMessage can be removed with this method. The intention is that those specific buffs are "owned" by the player who inflicts them, so they can be freely removed by multiplayer clients.

In all other cases code running on the server or in single player is in charge of the NPC debuffs and M:Terraria.NPC.DelBuff(System.Int32) should be used directly.

Parameters
buffTypeToRemoveThe buff type

Definition at line 106754 of file NPC.cs.

106755 {
106757 {
106758 return;
106759 }
106761 if (num != -1)
106762 {
106763 DelBuff(num);
106764 if (Main.netMode == 1)
106765 {
106766 NetMessage.SendData(137, -1, -1, null, whoAmI, buffTypeToRemove);
106767 }
106768 }
106769 }
int whoAmI
The index of this Entity within its specific array. These arrays track the entities in the world....
Definition Entity.cs:16
static bool[] CanBeRemovedByNetMessage
If true for a given T:Terraria.ID.BuffID, then that buff can be removed from an NPC using M:Terraria....
Definition BuffID.cs:62
int FindBuffIndex(int type)
Definition NPC.cs:106664
void DelBuff(int buffIndex)
Removes the buff at the provided index and shuffles the remaining buff indexes down to fill the gap....
Definition NPC.cs:106775

References Terraria.ID.BuffID.Sets.CanBeRemovedByNetMessage, Terraria.Main.netMode, and Terraria.NetMessage.SendData().

+ Here is the call graph for this function: