fix(garrison): despawn the finalize goober so it can't linger as construction scaffolding
Build (Windows x64) / build (push) Canceled after 0s
Build (Windows x64) / linux-build (push) Canceled after 0s

This commit is contained in:
luis
2026-08-20 19:37:09 -03:00
parent e82dba9679
commit fbf6ee8ad3
+8
View File
@@ -4319,6 +4319,14 @@ GameObject* Garrison::Plot::CreateGameObject(Map* map, GarrisonFactionIndex fact
finalizer->SetAnimKitId(animKit, false);
map->AddToMap(finalizer);
// Track the finalize goober alongside the building's other spawns so DeleteGameObject removes it.
// Its self-delete (SetSpellId above) only fires if the player *clicks* it to finalize construction;
// when the building is instead activated through the Architect UI (CMSG_GARRISON_SET_BUILDING_ACTIVE
// -> ActivateBuilding) the goober is never used and, being otherwise untracked, would linger on the
// plot as the construction scaffolding overlapping the finished building. Recording its GUID here lets
// every building transition (activate / place / cancel / swap / upgrade) despawn it via DeleteGameObject.
BuildingInfo.Spawns.insert(finalizer->GetGUID());
}
}
}