fix: taking an object down for one player leaves the other players' load queue alone

DestructEntity for one player (ghosting, or a model constructed again for
one player) also removed the object from the queue of every player still
loading, so a player loading at that moment never got it. Now only the
player it was taken down for loses it from their queue; taking an object
down for everyone still clears it for all.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-09-28 11:30:07 -05:00
parent d1a61450f9
commit 32448a8556

View File

@@ -452,7 +452,10 @@ void EntityManager::DestructEntity(Entity* entity, const SystemAddress& sysAddr)
Game::server->Send(stream, sysAddr, sysAddr == UNASSIGNED_SYSTEM_ADDRESS);
// Players still loading were to get it once loaded: only the ones it was taken down for (all of them, or the one
// player; taking it down for one player, e.g. out of their ghosting range, leaves the others' queue alone)
for (auto* player : PlayerManager::GetAllPlayers()) {
if (sysAddr != UNASSIGNED_SYSTEM_ADDRESS && player->GetSystemAddress() != sysAddr) continue;
if (!player->GetPlayerReadyForUpdates()) {
auto* ghostComponent = player->GetComponent<GhostComponent>();
if (ghostComponent) ghostComponent->RemoveLimboConstruction(entity->GetObjectID());