From 929774e1006a6fd3489859e6cf12bfa27a1c075c Mon Sep 17 00:00:00 2001 From: ZakFahey Date: Sat, 3 Oct 2026 16:40:40 -0700 Subject: [PATCH] Send the DamageNPCAck packet on rejected NpcStrike attempts If we don't ack the damage on a rejected packet, the NPC will appear to deplete its health only for that client. This results in NPCs that are perceived dead by the client when they actually aren't. --- TShockAPI/GetDataHandlers.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/TShockAPI/GetDataHandlers.cs b/TShockAPI/GetDataHandlers.cs index ead8b8388..2b15dbc8d 100644 --- a/TShockAPI/GetDataHandlers.cs +++ b/TShockAPI/GetDataHandlers.cs @@ -3386,6 +3386,16 @@ private static bool HandleProjectileNew(GetDataHandlerArgs args) } private static bool HandleNpcStrike(GetDataHandlerArgs args) + { + if (!HandleNpcStrikeInner(args)) + return false; + + // If we don't ack the damage on a rejected packet, the NPC will appear to deplete its health only for that client. + args.Player.SendData(PacketTypes.DamageNPCAck); + return true; + } + + private static bool HandleNpcStrikeInner(GetDataHandlerArgs args) { short id = args.Data.ReadInt8(); var generation = args.Data.ReadInt8();