Skip to content

Fix NPC component cleanup - #1175

Merged
AmyrAhmady merged 1 commit into
openmultiplayer:masterfrom
vincenzocorso:fix-npc-component-cleanup
Jan 7, 2026
Merged

AmyrAhmady merged 1 commit into
openmultiplayer:masterfrom
vincenzocorso:fix-npc-component-cleanup

Conversation

@vincenzocorso

@vincenzocorso vincenzocorso commented Jan 2, 2026 •

Copy link
Copy Markdown
Contributor

This PR solves #1160.

Problem

NPCs were not removed from the player pool during NPCComponent::free, causing a crash.

During shutdown, the NPC network is destroyed while NPCs remain in the player pool. Later, when textdraws are destroyed in OnGameModeExit, a "hide textdraw" packet is sent to each player—including NPCs. This causes a crash when the packet is tried to be sent through the already-destroyed NPC network.

Solution

Release all NPCs before destroying the component, ensuring they're removed from the player pool

@AmyrAhmady
AmyrAhmady merged commit d0e5388 into openmultiplayer:master Jan 7, 2026
12 checks passed
@vincenzocorso
vincenzocorso deleted the fix-npc-component-cleanup branch January 17, 2026 16:00
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.

2 participants