Merge pull request #2349 from moisterrific/patch-27

Fix getting kicked for throwing rotten eggs @ town NPCs while wearing Frost armor
This commit is contained in:
Chris 2021-05-28 17:48:59 +09:30 committed by GitHub
commit 5ff568ebde
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View file

@ -17,6 +17,7 @@ This is the rolling changelog for TShock for Terraria. Use past tense when addin
* Fixed torchgod settings to include whether or not torchgod has been fought by the player before and respect `usingBiomeTorches` setting. (@Quinci135) * Fixed torchgod settings to include whether or not torchgod has been fought by the player before and respect `usingBiomeTorches` setting. (@Quinci135)
* Fixed /worldmode not synchronising data to players after updating the world state (@bartico6, @Arthri) * Fixed /worldmode not synchronising data to players after updating the world state (@bartico6, @Arthri)
* Added `OnSendNetData` hook to TSAPI, which enables developers to intercept traffic being sent from the server to clients. (@Stealownz) * Added `OnSendNetData` hook to TSAPI, which enables developers to intercept traffic being sent from the server to clients. (@Stealownz)
* Fixed false positive `OnNPCAddBuff` detection when throwing rotten eggs at town NPCs while wearing Frost armor set. (@moisterrific)
## TShock 4.5.3 ## TShock 4.5.3
* Added permissions for using Teleportation Potions, Magic Conch, and Demon Conch. (@drunderscore) * Added permissions for using Teleportation Potions, Magic Conch, and Demon Conch. (@drunderscore)

View file

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