Update OnNPCAddBuff to account for Frost armor set

This fixes false positive cheat detection when throwing rotten eggs at town NPCs while wearing Frost armor set. Also made the debug and kick messages more clear for future reference.
This commit is contained in:
stacey 2021-05-26 19:31:46 -04:00 committed by GitHub
parent e5e66264d5
commit 09f75e0db9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1537,7 +1537,7 @@ namespace TShockAPI
if (npc.townNPC && npc.netID != NPCID.Guide && npc.netID != NPCID.Clothier)
{
if (type != BuffID.Lovestruck && type != BuffID.Stinky && type != BuffID.DryadsWard &&
type != BuffID.Wet && type != BuffID.Slimed && type != BuffID.GelBalloonBuff)
type != BuffID.Wet && type != BuffID.Slimed && type != BuffID.GelBalloonBuff && type != BuffID.Frostburn2)
{
detectedNPCBuffTimeCheat = true;
}
@ -1550,8 +1550,8 @@ namespace TShockAPI
if (detectedNPCBuffTimeCheat)
{
TShock.Log.ConsoleDebug("Bouncer / OnNPCAddBuff rejected abnormal buff ({1}) from {0}", args.Player.Name, type);
args.Player.Kick($"Added buff to NPC abnormally.", true);
TShock.Log.ConsoleDebug("Bouncer / OnNPCAddBuff rejected abnormal buff ({0}) added to {1} ({2}) from {3}.", type, npc.TypeName, npc.netID, args.Player.Name);
args.Player.Kick($"Added buff to {npc.TypeName} NPC abnormally.", true);
args.Handled = true;
}
}