Move dZoneManager to game namespace (#1143)

* convert zone manager to game namespace

* Destroy logger last
This commit is contained in:
David Markowitz
2023-07-17 15:55:33 -07:00
committed by GitHub
parent 080a833144
commit 3e3148e910
55 changed files with 169 additions and 175 deletions

View File

@@ -179,8 +179,8 @@ void Level::ReadSceneObjectDataChunk(std::istream& file, Header& header) {
//This is a little bit of a bodge, but because the alpha client (HF) doesn't store the
//spawn position / rotation like the later versions do, we need to check the LOT for the spawn pos & set it.
if (obj.lot == LOT_MARKER_PLAYER_START) {
dZoneManager::Instance()->GetZone()->SetSpawnPos(obj.position);
dZoneManager::Instance()->GetZone()->SetSpawnRot(obj.rotation);
Game::zoneManager->GetZone()->SetSpawnPos(obj.position);
Game::zoneManager->GetZone()->SetSpawnRot(obj.rotation);
}
std::u16string ldfString = u"";
@@ -297,7 +297,7 @@ void Level::ReadSceneObjectDataChunk(std::istream& file, Header& header) {
}
}
Spawner* spawner = new Spawner(spawnInfo);
dZoneManager::Instance()->AddSpawner(obj.id, spawner);
Game::zoneManager->AddSpawner(obj.id, spawner);
} else { //Regular object
EntityInfo info;
info.spawnerID = 0;
@@ -328,7 +328,7 @@ void Level::ReadSceneObjectDataChunk(std::istream& file, Header& header) {
if (!clientOnly) {
// We should never have more than 1 zone control object
const auto zoneControlObject = dZoneManager::Instance()->GetZoneControlObject();
const auto zoneControlObject = Game::zoneManager->GetZoneControlObject();
if (zoneControlObject != nullptr && info.lot == zoneControlObject->GetLOT())
goto deleteSettings;

View File

@@ -47,8 +47,8 @@ Spawner::Spawner(const SpawnerInfo info) {
if (m_Info.spawnOnSmashGroupName != "") {
std::vector<Entity*> spawnSmashEntities = Game::entityManager->GetEntitiesInGroup(m_Info.spawnOnSmashGroupName);
std::vector<Spawner*> spawnSmashSpawners = dZoneManager::Instance()->GetSpawnersInGroup(m_Info.spawnOnSmashGroupName);
std::vector<Spawner*> spawnSmashSpawnersN = dZoneManager::Instance()->GetSpawnersByName(m_Info.spawnOnSmashGroupName);
std::vector<Spawner*> spawnSmashSpawners = Game::zoneManager->GetSpawnersInGroup(m_Info.spawnOnSmashGroupName);
std::vector<Spawner*> spawnSmashSpawnersN = Game::zoneManager->GetSpawnersByName(m_Info.spawnOnSmashGroupName);
for (Entity* ssEntity : spawnSmashEntities) {
m_SpawnSmashFoundGroup = true;
ssEntity->AddDieCallback([=]() {

View File

@@ -149,7 +149,7 @@ void Zone::LoadZoneIntoMemory() {
info.activeOnLoad = path.spawner.spawnerNetActive;
info.isNetwork = true;
Spawner* spawner = new Spawner(info);
dZoneManager::Instance()->AddSpawner(info.spawnerID, spawner);
Game::zoneManager->AddSpawner(info.spawnerID, spawner);
}
}

View File

@@ -17,8 +17,6 @@
#include "../dWorldServer/ObjectIDManager.h"
dZoneManager* dZoneManager::m_Address = nullptr;
void dZoneManager::Initialize(const LWOZONEID& zoneID) {
Game::logger->Log("dZoneManager", "Preparing zone: %i/%i/%i", zoneID.GetMapID(), zoneID.GetInstanceID(), zoneID.GetCloneID());

View File

@@ -25,14 +25,6 @@ private:
void LoadWorldConfig();
public:
static dZoneManager* Instance() {
if (!m_Address) {
m_Address = new dZoneManager();
}
return m_Address;
}
void Initialize(const LWOZONEID& zoneID);
~dZoneManager();
@@ -64,7 +56,6 @@ private:
*/
uint32_t m_UniqueMissionIdStart = 0;
static dZoneManager* m_Address; //Singleton
Zone* m_pZone = nullptr;
LWOZONEID m_ZoneID;
bool m_PlayerLoseCoinsOnDeath; //Do players drop coins in this zone when smashed