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.
This commit is contained in:
Kelsi 2026-03-10 08:55:23 -07:00
parent a06ac018ea
commit 4f51103cdb

View file

@ -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();