From 6dd7213083f9a60c8bf3ee4c01af0ccfe953305d Mon Sep 17 00:00:00 2001 From: Kelsi Date: Wed, 11 Mar 2026 19:59:42 -0700 Subject: [PATCH] Fix zombie renderer instances on same-map SMSG_NEW_WORLD teleports When SMSG_NEW_WORLD fires with the same map ID (dungeon wing teleporters, GM teleports, etc.), entityManager.clear() was called but renderer instances in creatureInstances_/playerInstances_/gameObjectInstances_ were never despawned. Fresh CREATE_OBJECTs from the server hit the early-return guard (guid already in creatureInstances_) and were skipped, leaving entities in the entity manager without matching renderer state. Fix: pass isSameMap as isInitialEntry to the world-entry callback. This routes same-map SMSG_NEW_WORLD through the reconnect path which properly despawns all renderer instances before the server resends CREATE_OBJECTs. --- src/game/game_handler.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/game/game_handler.cpp b/src/game/game_handler.cpp index c92e9943..2b29ef80 100644 --- a/src/game/game_handler.cpp +++ b/src/game/game_handler.cpp @@ -17111,9 +17111,13 @@ void GameHandler::handleNewWorld(network::Packet& packet) { LOG_INFO("Sent MSG_MOVE_WORLDPORT_ACK"); } - // Reload terrain at new position + // Reload terrain at new position. + // Pass isSameMap as isInitialEntry so the application despawns and + // re-registers renderer instances before the server resends CREATE_OBJECTs. + // Without this, same-map SMSG_NEW_WORLD (dungeon wing teleporters, etc.) + // leaves zombie renderer instances that block fresh entity spawns. if (worldEntryCallback_) { - worldEntryCallback_(mapId, serverX, serverY, serverZ, false); + worldEntryCallback_(mapId, serverX, serverY, serverZ, isSameMap); } }