fix: Let's not ghost zone control (#1845)

* Let's not ghost zone control

* remove zonecontrol stuff
This commit is contained in:
David Markowitz
2025-07-18 10:15:45 -07:00
committed by GitHub
parent 49aa632d42
commit 71f708f1b5
2 changed files with 5 additions and 6 deletions

View File

@@ -129,6 +129,8 @@ Entity* EntityManager::CreateEntity(EntityInfo info, User* user, Entity* parentE
// Set the zone control entity if the entity is a zone control object, this should only happen once // Set the zone control entity if the entity is a zone control object, this should only happen once
if (controller) { if (controller) {
m_ZoneControlEntity = entity; m_ZoneControlEntity = entity;
// Proooooobably shouldn't ghost zoneControl
m_ZoneControlEntity->SetIsGhostingCandidate(false);
} }
// Check if this entity is a respawn point, if so add it to the registry // Check if this entity is a respawn point, if so add it to the registry
@@ -394,7 +396,7 @@ void EntityManager::ConstructAllEntities(const SystemAddress& sysAddr) {
} }
} }
UpdateGhosting(PlayerManager::GetPlayer(sysAddr), true); UpdateGhosting(PlayerManager::GetPlayer(sysAddr));
} }
void EntityManager::DestructEntity(Entity* entity, const SystemAddress& sysAddr) { void EntityManager::DestructEntity(Entity* entity, const SystemAddress& sysAddr) {
@@ -463,7 +465,7 @@ void EntityManager::UpdateGhosting() {
m_PlayersToUpdateGhosting.clear(); m_PlayersToUpdateGhosting.clear();
} }
void EntityManager::UpdateGhosting(Entity* player, const bool constructAll) { void EntityManager::UpdateGhosting(Entity* player) {
if (!player) return; if (!player) return;
auto* missionComponent = player->GetComponent<MissionComponent>(); auto* missionComponent = player->GetComponent<MissionComponent>();
@@ -513,9 +515,6 @@ void EntityManager::UpdateGhosting(Entity* player, const bool constructAll) {
entity->SetObservers(entity->GetObservers() + 1); entity->SetObservers(entity->GetObservers() + 1);
// TODO: figure out if zone control should be ghosted at all
if (constructAll && entity->GetObjectID() == GetZoneControlEntity()->GetObjectID()) continue;
ConstructEntity(entity, player->GetSystemAddress()); ConstructEntity(entity, player->GetSystemAddress());
} }
} }

View File

@@ -58,7 +58,7 @@ public:
void SetGhostDistanceMin(float value); void SetGhostDistanceMin(float value);
void QueueGhostUpdate(LWOOBJID playerID); void QueueGhostUpdate(LWOOBJID playerID);
void UpdateGhosting(); void UpdateGhosting();
void UpdateGhosting(Entity* player, const bool constructAll = false); void UpdateGhosting(Entity* player);
void CheckGhosting(Entity* entity); void CheckGhosting(Entity* entity);
Entity* GetGhostCandidate(LWOOBJID id) const; Entity* GetGhostCandidate(LWOOBJID id) const;
bool GetGhostingEnabled() const; bool GetGhostingEnabled() const;