mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-02 10:53:44 +00:00
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:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user