Skip to content

hmp-npcs: Remove a destroyed NPC by its normalized id - #16

Open
spadieri85 wants to merge 1 commit into
hogwarts-mp:mainfrom
spadieri85:hmp-npcs-destroy-normalized-id
Open

spadieri85 wants to merge 1 commit into
hogwarts-mp:mainfrom
spadieri85:hmp-npcs-destroy-normalized-id

Conversation

@spadieri85

Copy link
Copy Markdown

destroy looked the entry up with integer(id) but deleted it with the raw argument. When the id arrives as a numeric string (e.g. across a resource export), the NPC is destroyed but stays in managed: it keeps counting against maximumPerResource, and clear/stop destroy it a second time.

The fix deletes by the normalized key. The test destroys an NPC by its string id and checks the registry count, a second destroy and that stop doesn't destroy it again. npm run verify passes.

destroy looked the entry up with the normalized integer id but deleted it
with the raw argument. An id that arrives as a numeric string, as it can
across a resource export, found and destroyed the NPC yet left it in the
registry: it kept counting against the resource's limit and clear and stop
destroyed it a second time.
@spadieri85
spadieri85 force-pushed the hmp-npcs-destroy-normalized-id branch from 77ad41c to ed11b6f Compare October 17, 2026 23:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant