fixe the issue where players recently fired bullets would be saved to an invalid index - #3308
Controllerdestiny wants to merge 2 commits into
Conversation
…o an invalid index
Greptile SummaryThis PR replaces resolved projectile indices with packet-local identities when dispatching and recording newly created projectiles, and exposes a dash-control bit in the player-update model.
Confidence Score: 4/5This PR is not safe to merge until recent-projectile tracking uses an identity representation consistent with its The changed creation path stores an owner-scoped packet identity where several existing checks require a server-global projectile index, causing those checks to inspect unrelated projectile state and leaving kill tracking inconsistent. Files Needing Attention: TShockAPI/GetDataHandlers.cs Important Files Changed
Reviews (1): Last reviewed commit: "fixed the issue where players recently f..." | Re-trigger Greptile |
| if (!args.Player.RecentlyCreatedProjectiles.Any(p => p.Index == ident)) | ||
| { | ||
| args.Player.RecentlyCreatedProjectiles.Add(new GetDataHandlers.ProjectileStruct() | ||
| { | ||
| Index = index, | ||
| Index = ident, |
There was a problem hiding this comment.
Projectile identity domains conflict
ident is the owner-scoped value from ProjectileKey.Index, but ProjectileStruct.Index is documented and consumed as an index into Main.projectile. When those values differ, the rope, portal, liquid, and fishing checks inspect an unrelated projectile. Kill handling also searches recent entries using the resolved server index, while generation reuse is deduplicated using only ident. As a result, legitimate projectile-backed actions can be rejected or unrelated actions can be accepted.
Knowledge Base Used:
This will cause an invalid index to be stored when creating bullets, and using the RecentlyCreatedProjectiles code may have potential issues, just like the portal detection in Bouncer.