From 4f51103cdba0ad29d55ac9b9d957d361360baa89 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Tue, 10 Mar 2026 08:55:23 -0700 Subject: [PATCH] game: clear permanent-failure and dead-creature caches on same-map reconnect After reconnect, `creaturePermanentFailureGuids_` and `deadCreatureGuids_` could retain stale entries for GUIDs not tracked in `creatureInstances_` (creatures that failed to load or died before being spawned). These stale entries would silently block re-spawning or cause wrong death state on the fresh CREATE_OBJECTs the server sends after reconnect. Clear both caches in the reconnect-to-same-map path so server state is authoritative after every reconnect. --- src/core/application.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/application.cpp b/src/core/application.cpp index acbf1971..11a5063f 100644 --- a/src/core/application.cpp +++ b/src/core/application.cpp @@ -1701,10 +1701,12 @@ void Application::setupUICallbacks() { if (mapId == loadedMapId_ && renderer && renderer->getTerrainManager() && isInitialEntry) { LOG_INFO("Reconnect to same map ", mapId, ": clearing stale online entities (terrain preserved)"); - // Pending spawn queues + // Pending spawn queues and failure caches pendingCreatureSpawns_.clear(); pendingCreatureSpawnGuids_.clear(); creatureSpawnRetryCounts_.clear(); + creaturePermanentFailureGuids_.clear(); // Clear so previously-failed GUIDs can retry + deadCreatureGuids_.clear(); // Will be re-populated from fresh server state pendingPlayerSpawns_.clear(); pendingPlayerSpawnGuids_.clear(); pendingOnlinePlayerEquipment_.clear();