Skip to content

Send the DamageNPCAck packet on rejected NpcStrike attempts - #3318

Open
ZakFahey wants to merge 1 commit into
general-develfrom
npc-damage-ack
Open

ZakFahey wants to merge 1 commit into
general-develfrom
npc-damage-ack

Conversation

@ZakFahey

@ZakFahey ZakFahey commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

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.

bug.report.mp4

Changelog message: Fixed a bug with NPC damage rejections.

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.
@greptile-apps

greptile-apps Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

[Medium risk] Changes NPC damage packet handling logic.

The PR appears safe to merge, with a non-blocking need for focused coverage of the new acknowledgement branch.

Findings

  1. P2 Acknowledgement branch lacks tests ▶

Summary

The PR wraps NPC-strike validation so rejected strikes receive a DamageNPCAck before the packet is consumed.

  • Accepted strikes retain the existing path to normal processing.
  • Focused tests would protect the distinction between rejected and accepted strikes.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[NPC strike packet] --> B[HandleNpcStrikeInner]
  B -->|Rejected: true| C[Send DamageNPCAck]
  C --> D[Return true: consume packet]
  B -->|Accepted: false| E[Return false: continue processing]
Loading

Reviews (1) · Last reviewed commit: "Send the DamageNPCAck packet on rejected..."

Comment thread TShockAPI/GetDataHandlers.cs

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant