diff --git a/Source/Client/Application/UnhandledExceptionHandler.cpp b/Source/Client/Application/UnhandledExceptionHandler.cpp index f4346cd7..132e6f4d 100644 --- a/Source/Client/Application/UnhandledExceptionHandler.cpp +++ b/Source/Client/Application/UnhandledExceptionHandler.cpp @@ -1,6 +1,6 @@ #include "Client/Application/LaunchInfo.h" #include "Client/Application/Launcher.h" -#include "Client/Mode/ActiveGameMode.h" +#include "Client/Mode/ModeMgr.h" #include "Client/Application/UnhandledExceptionHandler.h" #include "Client/Session.h" @@ -57,8 +57,8 @@ namespace { // INLINED const char* ReadCurrentMapName() { - if (g_world.state == 1 && g_world.gameMode != nullptr) { - return reinterpret_cast(g_world.gameMode) + 0x68; + if (g_modeMgr.state == 1 && g_modeMgr.gameMode != nullptr) { + return reinterpret_cast(g_modeMgr.gameMode) + 0x68; } return nullptr; diff --git a/Source/Client/Mode/CGameMode.h b/Source/Client/Mode/CGameMode.h index f7ca6bbe..8870ecae 100644 --- a/Source/Client/Mode/CGameMode.h +++ b/Source/Client/Mode/CGameMode.h @@ -11,14 +11,14 @@ class CView; class CCorpse; struct ActorNameAllPacket; -struct WorldScene; +struct CWorld; class CGameMode : public CMode { public: /* 0058 */ unsigned char unknown_0058[0x10]; /* 0068 */ char mapName[16]; /* 0078 */ unsigned char unknown_0078[0x54]; - /* 00CC */ WorldScene* scene; + /* 00CC */ CWorld* scene; /* 00D0 */ CView* camera; /* 00D4 */ unsigned char unknown_00D4[0x8C]; /* 0160 */ CActorNameCardHolder nameCard; diff --git a/Source/Client/Mode/ActiveGameMode.cpp b/Source/Client/Mode/ModeMgr.cpp similarity index 81% rename from Source/Client/Mode/ActiveGameMode.cpp rename to Source/Client/Mode/ModeMgr.cpp index 61affaaf..87a0cd5c 100644 --- a/Source/Client/Mode/ActiveGameMode.cpp +++ b/Source/Client/Mode/ModeMgr.cpp @@ -1,18 +1,18 @@ -#include "Client/Mode/ActiveGameMode.h" +#include "Client/Mode/ModeMgr.h" // STATIC: 0x013495b8 // GLOBAL: gl_24475 -CWorld g_world = {1}; +CModeMgr g_modeMgr = {1}; // OFFSET: 0x00AD6450 // FUNCTION: fn_17831 -CMode* CWorld::GetGameMode() { +CMode* CModeMgr::GetGameMode() { return this->state == 1 ? this->gameMode : nullptr; } // OFFSET: 0x00AD6460 // FUNCTION: fn_17832 -CMode* CWorld::GetLoginMode() { +CMode* CModeMgr::GetLoginMode() { return this->state == 0 ? this->gameMode : nullptr; } diff --git a/Source/Client/Mode/ActiveGameMode.h b/Source/Client/Mode/ModeMgr.h similarity index 70% rename from Source/Client/Mode/ActiveGameMode.h rename to Source/Client/Mode/ModeMgr.h index 0bbcf9a8..88a51cb2 100644 --- a/Source/Client/Mode/ActiveGameMode.h +++ b/Source/Client/Mode/ModeMgr.h @@ -1,9 +1,9 @@ -#ifndef RAGNAROK_SOURCE_CLIENT_MODE_ACTIVEGAMEMODE_H -#define RAGNAROK_SOURCE_CLIENT_MODE_ACTIVEGAMEMODE_H +#ifndef RAGNAROK_SOURCE_CLIENT_MODE_MODEMGR_H +#define RAGNAROK_SOURCE_CLIENT_MODE_MODEMGR_H #include "Client/Mode/CMode.h" -struct CWorld { +struct CModeMgr { /* 0000 */ int running; /* 0004 */ CMode* gameMode; /* 0008 */ unsigned char unknown_0008[0x28]; @@ -17,6 +17,6 @@ struct CWorld { void Switch(int mode, const char* name); }; -extern CWorld g_world; +extern CModeMgr g_modeMgr; #endif diff --git a/Source/Client/ModeBaseEvents.cpp b/Source/Client/ModeBaseEvents.cpp index 15e242af..df6ddcb7 100644 --- a/Source/Client/ModeBaseEvents.cpp +++ b/Source/Client/ModeBaseEvents.cpp @@ -1,5 +1,5 @@ #include "Client/ModeBaseEvents.h" -#include "Client/Mode/ActiveGameMode.h" +#include "Client/Mode/ModeMgr.h" #include "Contents/Configuration/ServiceConfiguration.h" #include "Contents/Party/AdventurerAgencyMgr.h" #include "Contents/UserData/AccountLinkedUserDataMgr.h" @@ -12,20 +12,20 @@ int ModeBaseEvents::Send(int event, const char* text, int, int, int) { if (event == 2) { g_accountLinkedUserDataMgr->Save(this->emotions, this->script, this->persistenceAccountId, this->renderSystem, this->token16, this->work); - if (g_world.state != 1) { - if (g_world.gameMode) { - g_world.gameMode->running = 0; + if (g_modeMgr.state != 1) { + if (g_modeMgr.gameMode) { + g_modeMgr.gameMode->running = 0; } - } else if (g_world.gameMode) { + } else if (g_modeMgr.gameMode) { g_characterLinkedUserDataMgr->Save(this->characterSave, this->token16, this->work); - if (g_world.state != 1) { - if (g_world.gameMode) { - g_world.gameMode->running = 0; + if (g_modeMgr.state != 1) { + if (g_modeMgr.gameMode) { + g_modeMgr.gameMode->running = 0; } - } else if (g_world.gameMode) { + } else if (g_modeMgr.gameMode) { g_adventurerAgencyMgr->RequestStop(this->agency, this->stopRecruiting); - if (g_world.gameMode) { - g_world.gameMode->running = 0; + if (g_modeMgr.gameMode) { + g_modeMgr.gameMode->running = 0; } } } @@ -33,7 +33,7 @@ int ModeBaseEvents::Send(int event, const char* text, int, int, int) { if (g_serviceType == 11) { ShellExecuteA(this->window, "open", "http://www.ragnarok.co.in/index.php", nullptr, nullptr, SW_SHOWNORMAL); } - g_world.running = 0; + g_modeMgr.running = 0; } else if (event == 68) { this->transitionRequested = 1; if (text) { diff --git a/Source/Client/ModeTransitions.cpp b/Source/Client/ModeTransitions.cpp index 019e889f..f80becb0 100644 --- a/Source/Client/ModeTransitions.cpp +++ b/Source/Client/ModeTransitions.cpp @@ -1,5 +1,5 @@ #include "Client/Application/ApplicationWindow.h" -#include "Client/Mode/ActiveGameMode.h" +#include "Client/Mode/ModeMgr.h" #include "Contents/Configuration/ServiceConfiguration.h" #include @@ -7,7 +7,7 @@ // OFFSET: 0x00AD67E0 // FUNCTION: fn_17845 -void CWorld::Quit() { +void CModeMgr::Quit() { if (this->gameMode) { this->gameMode->running = 0; } @@ -20,7 +20,7 @@ void CWorld::Quit() { // OFFSET: 0x00AD7620 // FUNCTION: fn_17851 -void CWorld::Switch(int mode, const char* name) { +void CModeMgr::Switch(int mode, const char* name) { this->gameMode->running = 0; std::strcpy(this->nextModeName, name); this->nextState = mode; diff --git a/Source/Contents/ActorGeometry.cpp b/Source/Contents/ActorGeometry.cpp index 48bbfc3f..5a2cb370 100644 --- a/Source/Contents/ActorGeometry.cpp +++ b/Source/Contents/ActorGeometry.cpp @@ -1,8 +1,8 @@ -#include "Client/Mode/ActiveGameMode.h" +#include "Client/Mode/ModeMgr.h" #include "Client/Mode/CGameMode.h" #include "Client/Session.h" #include "Contents/Actors/RenderObject.h" -#include "Contents/World/WorldScene.h" +#include "Contents/World/World.h" #include "Utility/Math/AffineMatrix.h" #include @@ -64,7 +64,7 @@ float CRenderObject::Distance(float x, float y, float z) const { // OFFSET: 0x00CAD9E0 // FUNCTION: fn_21057 bool CRenderObject::GetTargetPos(std::uint32_t targetAid, vector3d& targetPos) const { - const WorldScene* world = static_cast(g_world.GetGameMode())->scene; + const CWorld* world = static_cast(g_modeMgr.GetGameMode())->scene; const CRenderObject* player = reinterpret_cast(world->player); if (targetAid == g_session.m_aid) { diff --git a/Source/Contents/Actors/GameObject.cpp b/Source/Contents/Actors/GameObject.cpp index 4abcda42..a0be9311 100644 --- a/Source/Contents/Actors/GameObject.cpp +++ b/Source/Contents/Actors/GameObject.cpp @@ -1,11 +1,11 @@ #include "Contents/Actors/GameObject.h" #include "Contents/Actors/GameActor.h" -#include "Client/Mode/ActiveGameMode.h" +#include "Client/Mode/ModeMgr.h" #include "Client/Mode/CGameMode.h" #include "Contents/Camera/Camera.h" #include "Client/Replay.h" #include "Contents/Jobs/JobInheritance.h" -#include "Contents/World/WorldScene.h" +#include "Contents/World/World.h" #include "Contents/Actors/RenderObject.h" #include "Contents/Configuration/ServiceConfiguration.h" #include "Render/DeviceContext/DCSurface.h" @@ -61,7 +61,7 @@ void CGameObject::Draw(int) { // OFFSET: 0x00CABF10 // FUNCTION: fn_21041 int CGameObject::GetDir(float rot) { - CGameMode* gameMode = static_cast(g_world.GetGameMode()); + CGameMode* gameMode = static_cast(g_modeMgr.GetGameMode()); int longitude = 0; if (gameMode) { @@ -122,7 +122,7 @@ void CRenderObject::DrawShadow(int argument, float scale) { const float* matrix = reinterpret_cast(argument); const float z = this->render.position.z; - CGameMode* mode = static_cast(g_world.GetGameMode()); + CGameMode* mode = static_cast(g_modeMgr.GetGameMode()); float position[3]; position[0] = this->render.position.x; position[1] = mode->scene->terrain->Grid().Height(this->render.position.x, this->render.position.z); diff --git a/Source/Contents/Actors/RenderObject.cpp b/Source/Contents/Actors/RenderObject.cpp index 9a6f9d10..2906d650 100644 --- a/Source/Contents/Actors/RenderObject.cpp +++ b/Source/Contents/Actors/RenderObject.cpp @@ -1,6 +1,6 @@ #include "Contents/Actors/RenderObject.h" -#include "Client/Mode/ActiveGameMode.h" +#include "Client/Mode/ModeMgr.h" #include "Client/Mode/CGameMode.h" #include "Client/Session.h" #include "Client/Replay.h" @@ -298,7 +298,7 @@ int CRenderObject::HoverHeight() { } const short height = static_cast(ClientSine(angle) * 4.0f + this->render.unknown_00FA); - CGameMode* mode = static_cast(g_world.GetGameMode()); + CGameMode* mode = static_cast(g_modeMgr.GetGameMode()); const short scaled = static_cast(400.0f / mode->camera->camera.desiredDistance * height); return scaled < 0 ? 0 : scaled; } @@ -489,7 +489,7 @@ void CRenderObject::JitterBounds(float* output, const int* input, float offset, } } - CGameMode* mode = static_cast(g_world.GetGameMode()); + CGameMode* mode = static_cast(g_modeMgr.GetGameMode()); jitter[index] = 400.0f / mode->camera->camera.desiredDistance * static_cast(value - base); } @@ -670,7 +670,7 @@ float* CGameActor::Slot53(int index) { // OFFSET: 0x00CAE500 // FUNCTION: fn_21074 void CGameActor::Slot38() { - CGameMode* mode = static_cast(g_world.GetGameMode()); + CGameMode* mode = static_cast(g_modeMgr.GetGameMode()); const float angle = this->render.angle; const int motion = this->render.curMotion; const int animation = this->render.animation; diff --git a/Source/Contents/Camera/Camera.h b/Source/Contents/Camera/Camera.h index 04f6178a..ff9a6fc9 100644 --- a/Source/Contents/Camera/Camera.h +++ b/Source/Contents/Camera/Camera.h @@ -6,7 +6,7 @@ #include -struct WorldScene; +struct CWorld; extern float g_cameraDistance; @@ -18,7 +18,7 @@ public: /* 0050 */ unsigned char unknown_0050[0x30]; /* 0080 */ CameraFrame frame; /* 00F8 */ unsigned char unknown_00F8[0xB8]; - /* 01B0 */ WorldScene* scene; + /* 01B0 */ CWorld* scene; /* 01B4 */ unsigned char unknown_01B4[4]; }; diff --git a/Source/Contents/Effects/Effect.cpp b/Source/Contents/Effects/Effect.cpp index 8b94b34f..c6cdf109 100644 --- a/Source/Contents/Effects/Effect.cpp +++ b/Source/Contents/Effects/Effect.cpp @@ -2,7 +2,7 @@ #include "Contents/Actors/RenderObject.h" #include "Contents/Effects/EffectLists.h" -#include "Contents/World/WorldScene.h" +#include "Contents/World/World.h" // OFFSET: 0x00B4DAE0 // FUNCTION: fn_18979 diff --git a/Source/Contents/Effects/EffectPrimitiveMotion.cpp b/Source/Contents/Effects/EffectPrimitiveMotion.cpp index 109adae1..96b3b2ec 100644 --- a/Source/Contents/Effects/EffectPrimitiveMotion.cpp +++ b/Source/Contents/Effects/EffectPrimitiveMotion.cpp @@ -1,9 +1,9 @@ #include "Contents/Effects/EffectPrimitiveMotion.h" #include "Client/Mode/CGameMode.h" -#include "Client/Mode/ActiveGameMode.h" +#include "Client/Mode/ModeMgr.h" #include "Client/Session.h" #include "Contents/Camera/Camera.h" -#include "Contents/World/WorldScene.h" +#include "Contents/World/World.h" #include "Resource/Sprites/ActionResource.h" #include "Contents/Effects/EffectPrim.h" #include "Contents/Effects/EffectPrimitiveState.h" @@ -64,7 +64,7 @@ namespace { // INLINED void FaceCamera(EffectPrimitiveSlot* slots) { - const CView* view = static_cast(g_world.GetGameMode())->camera; + const CView* view = static_cast(g_modeMgr.GetGameMode())->camera; slots[0].alphaT = static_cast(360 - static_cast(view->camera.yaw)); slots[1].alphaT = static_cast(360 - static_cast(view->camera.pitch) + 90); @@ -1414,7 +1414,7 @@ void CEffectPrim::PrimGuard() { // OFFSET: 0x00BBFAA0 // FUNCTION: fn_19818 bool CEffectPrim::PrimLineLink() { - CGameMode* gameMode = static_cast(g_world.GetGameMode()); + CGameMode* gameMode = static_cast(g_modeMgr.GetGameMode()); const CRenderObject* target = nullptr; const CRagEffect* master = this->state.master; @@ -1721,7 +1721,7 @@ bool CEffectPrim::PrimKouenka() { this->render.position = this->state.offset; if ((this->state.flags & 0x20) != 0) { - this->state.unknown_0314 = this->render.angle - static_cast(g_world.GetGameMode())->camera->camera.yaw; + this->state.unknown_0314 = this->render.angle - static_cast(g_modeMgr.GetGameMode())->camera->camera.yaw; } this->state.ProcessAlpha(); @@ -1783,7 +1783,7 @@ bool CEffectPrim::PrimSakura() { this->render.position = this->state.offset; if ((this->state.flags & 0x20) != 0) { - this->state.unknown_0314 = this->render.angle - static_cast(g_world.GetGameMode())->camera->camera.yaw; + this->state.unknown_0314 = this->render.angle - static_cast(g_modeMgr.GetGameMode())->camera->camera.yaw; } this->state.ProcessAlpha(); @@ -2068,7 +2068,7 @@ bool CEffectPrim::PrimGhost() { slot.vecBPre.y += slot.maxHeight * g_sinTable[slot.riseAngle]; this->state.offset = slot.vecBPre; - const CView* view = static_cast(g_world.GetGameMode())->camera; + const CView* view = static_cast(g_modeMgr.GetGameMode())->camera; int angle = slot.rotStart + static_cast(view->camera.yaw); if (angle < 0) { @@ -2379,7 +2379,7 @@ bool CEffectPrim::UpdateHit6() { } if ((this->state.flags & 0x20u) != 0) { - this->state.unknown_0314 = this->render.angle - static_cast(g_world.GetGameMode())->camera->camera.yaw; + this->state.unknown_0314 = this->render.angle - static_cast(g_modeMgr.GetGameMode())->camera->camera.yaw; } this->state.ProcessAlpha(); @@ -2390,7 +2390,7 @@ bool CEffectPrim::UpdateHit6() { // OFFSET: 0x00BB75B0 // FUNCTION: fn_19780 bool CEffectPrim::UpdateCoin() { - CGameMode* mode = static_cast(g_world.GetGameMode()); + CGameMode* mode = static_cast(g_modeMgr.GetGameMode()); const CRagEffect* master = this->state.master; this->state.origin.z = master->render.position.z + this->state.velocity.z; this->state.origin.y = master->render.position.y + this->state.velocity.y; @@ -2416,7 +2416,7 @@ bool CEffectPrim::UpdateCoin() { if (this->state.unknown_0208 == 1) { char name[52]; std::sprintf(name, "effect\\EF_Coin%d.wav", rand() % 3 + 1); - const auto* player = reinterpret_cast(static_cast(g_world.GetGameMode())->scene->player); + const auto* player = reinterpret_cast(static_cast(g_modeMgr.GetGameMode())->scene->player); g_soundMgr->PlayWave( name, this->render.position.x - player->render.position.x, 0.0f, this->render.position.z - player->render.position.z, 250, 40, 1.0f, 0 ); @@ -2514,7 +2514,7 @@ bool CEffectPrim::UpdateDetoxication() { this->render.position.z = positionZ + this->state.offset.z; if ((flags & 0x20u) != 0) { - this->state.unknown_0314 = this->render.angle - static_cast(g_world.GetGameMode())->camera->camera.yaw; + this->state.unknown_0314 = this->render.angle - static_cast(g_modeMgr.GetGameMode())->camera->camera.yaw; } this->state.ProcessAlpha(); diff --git a/Source/Contents/Ground/TerrainCoordinates.cpp b/Source/Contents/Ground/TerrainCoordinates.cpp index 7218d45d..0c5efe7b 100644 --- a/Source/Contents/Ground/TerrainCoordinates.cpp +++ b/Source/Contents/Ground/TerrainCoordinates.cpp @@ -1,6 +1,6 @@ #include "Client/Mode/CGameMode.h" #include "Contents/Ground/TerrainHeight.h" -#include "Contents/World/WorldScene.h" +#include "Contents/World/World.h" #include "Resource/World/TerrainResource.h" #include "Utility/Math/ScalarConversion.h" diff --git a/Source/Contents/Jobs/JobInheritance.cpp b/Source/Contents/Jobs/JobInheritance.cpp index 43b43b33..fa529e37 100644 --- a/Source/Contents/Jobs/JobInheritance.cpp +++ b/Source/Contents/Jobs/JobInheritance.cpp @@ -1,4 +1,4 @@ -#include "Client/Mode/ActiveGameMode.h" +#include "Client/Mode/ModeMgr.h" #include "Client/Mode/CMode.h" #include "Contents/Items/ItemDescription.h" #include "Contents/Skills/SkillInfo.h" @@ -697,7 +697,7 @@ int CSession::SetHotkeyEntry(char enabled, int id, int value, int slot) { entry.unknown_0000 = 0; entry.itemId = 0; entry.unknown_0005 = 0; - g_world.GetGameMode()->SendMsg(313, index + 36, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(313, index + 36, 0, 0, 0); } } @@ -711,7 +711,7 @@ int CSession::SetHotkeyEntry(char enabled, int id, int value, int slot) { target.itemId = static_cast(id); target.unknown_0005 = static_cast(value); - return g_world.GetGameMode()->SendMsg(313, slot + 36, 0, 0, 0); + return g_modeMgr.GetGameMode()->SendMsg(313, slot + 36, 0, 0, 0); } // OFFSET: 0x00E26030 diff --git a/Source/Contents/Messenger/ClientMessenger.cpp b/Source/Contents/Messenger/ClientMessenger.cpp index 154323cf..a834221d 100644 --- a/Source/Contents/Messenger/ClientMessenger.cpp +++ b/Source/Contents/Messenger/ClientMessenger.cpp @@ -1,6 +1,6 @@ #include "Contents/Messenger/ClientMessenger.h" #include "Contents/Effects/PartyMemberEffects.h" -#include "Client/Mode/ActiveGameMode.h" +#include "Client/Mode/ModeMgr.h" #include "Client/Mode/CGameMode.h" #include "Client/Session.h" #include "Contents/ClientState.h" @@ -766,7 +766,7 @@ void SessionMessengerContext::UpdateRandomStats() { } const auto notify = [this]() { - if (g_world.GetGameMode()) { + if (g_modeMgr.GetGameMode()) { if (g_windowMgr.unknown_01DC) { if (this->bound6C < this->bound68 || this->bound74 < this->bound70) { return; @@ -774,7 +774,7 @@ void SessionMessengerContext::UpdateRandomStats() { reinterpret_cast(g_windowMgr.unknown_01DC)->Invalidate(); reinterpret_cast(g_windowMgr.unknown_01DC)->InvalidateChildren(); } - static_cast(g_world.GetGameMode())->NotifyItemBounds(); + static_cast(g_modeMgr.GetGameMode())->NotifyItemBounds(); } }; if (this->bound68 != bound68) { diff --git a/Source/Contents/MonsterSpeech.cpp b/Source/Contents/MonsterSpeech.cpp index 5f3a85e5..8fa8fab6 100644 --- a/Source/Contents/MonsterSpeech.cpp +++ b/Source/Contents/MonsterSpeech.cpp @@ -1,4 +1,4 @@ -#include "Client/Mode/ActiveGameMode.h" +#include "Client/Mode/ModeMgr.h" #include "Client/Mode/CGameMode.h" #include "Client/Session.h" @@ -100,7 +100,7 @@ void CSession::FormatMonsterSpeech(char* text, char* output, std::uint32_t aid, } } - const std::string name = static_cast(g_world.GetGameMode())->nameCard.Name(aid); + const std::string name = static_cast(g_modeMgr.GetGameMode())->nameCard.Name(aid); const char* speaker; if (!name.empty()) { speaker = name.c_str(); diff --git a/Source/Contents/NavigationRequest.cpp b/Source/Contents/NavigationRequest.cpp index 9edb4850..d4bddd3a 100644 --- a/Source/Contents/NavigationRequest.cpp +++ b/Source/Contents/NavigationRequest.cpp @@ -1,7 +1,7 @@ #include "Contents/NavigationManager.h" -#include "Client/Mode/ActiveGameMode.h" +#include "Client/Mode/ModeMgr.h" #include "Client/Mode/CGameMode.h" -#include "Contents/World/WorldScene.h" +#include "Contents/World/World.h" #include "Client/Session.h" #include "Resource/ResourceMgr.h" @@ -87,7 +87,7 @@ bool CNaviData::SetDestination(CNaviInfo* info, int cellX, int cellY) { // OFFSET: 0x00BA1260 // FUNCTION: fn_19638 bool CNavigationManager::UpdateGround() { - CGameMode* mode = static_cast(g_world.GetGameMode()); + CGameMode* mode = static_cast(g_modeMgr.GetGameMode()); if (mode == nullptr || mode->scene == nullptr || mode->scene->terrain == nullptr) { return false; } @@ -144,7 +144,7 @@ int CNavigationManager::RequestRoute(int cellX, int cellY) { int startX = 0; int startY = 0; - CGameMode* mode = static_cast(g_world.GetGameMode()); + CGameMode* mode = static_cast(g_modeMgr.GetGameMode()); if (mode == nullptr) { return -95; } diff --git a/Source/Contents/Skills/ClientSkills.cpp b/Source/Contents/Skills/ClientSkills.cpp index 143a8c15..e65c132c 100644 --- a/Source/Contents/Skills/ClientSkills.cpp +++ b/Source/Contents/Skills/ClientSkills.cpp @@ -1,5 +1,5 @@ #include "Contents/Skills/ClientSkills.h" -#include "Client/Mode/ActiveGameMode.h" +#include "Client/Mode/ModeMgr.h" #include "Client/Mode/CGameMode.h" #include "Client/Session.h" #include "Contents/Actors/RenderObject.h" @@ -7,7 +7,7 @@ #include "Contents/Jobs/JobId.h" #include "Contents/Jobs/JobInheritance.h" #include "Contents/UserData/CharacterConfigSave.h" -#include "Contents/World/WorldScene.h" +#include "Contents/World/World.h" #include "Script/LuaScript.h" #include "UI/Shortcuts/ShortcutBindings.h" #include "UI/Window/UIWindow.h" @@ -444,7 +444,7 @@ void CSession::EraseUnknownKey(std::int64_t key) { // FUNCTION: fn_23772 int CSession::CountProhibitionLog(std::uint32_t aid) { const int count = static_cast(this->m_prohibitionLog.size()); - const CRenderObject* actor = static_cast(g_world.GetGameMode())->scene->GetGameActorByAID(aid); + const CRenderObject* actor = static_cast(g_modeMgr.GetGameMode())->scene->GetGameActorByAID(aid); if (!actor) { return -1; } @@ -731,7 +731,7 @@ int CharacterConfigSave::SkillLevel(int id) const { // OFFSET: 0x00E094E0 // FUNCTION: fn_23778 CRenderObject* CSession::FindGameActor(std::uint32_t aid) const { - CGameMode* mode = static_cast(g_world.GetGameMode()); + CGameMode* mode = static_cast(g_modeMgr.GetGameMode()); if (mode == nullptr) { return nullptr; } diff --git a/Source/Contents/Skills/SkillInfo.cpp b/Source/Contents/Skills/SkillInfo.cpp index 9a621d70..87ca8635 100644 --- a/Source/Contents/Skills/SkillInfo.cpp +++ b/Source/Contents/Skills/SkillInfo.cpp @@ -1,4 +1,4 @@ -#include "Client/Mode/ActiveGameMode.h" +#include "Client/Mode/ModeMgr.h" #include "Client/Mode/CGameMode.h" #include "Contents/Actors/GameActor.h" #include "Contents/Effects/EffectActor.h" @@ -9,7 +9,7 @@ #include "Contents/Skills/SkillInfo.h" #include "Contents/Sound/SoundMgr.h" #include "Contents/UserData/NormalItemSlots.h" -#include "Contents/World/WorldScene.h" +#include "Contents/World/World.h" #include "Resource/World/TerrainResource.h" #include "Script/LuaScript.h" @@ -596,16 +596,16 @@ std::pair CSkillActionMgr::ActionSlot01(int skillId) { // OFFSET: 0x0077AD90 // FUNCTION: fn_08405 vector3d CellWorldPosition(int column, int row) { - if (!g_world.GetGameMode() || !static_cast(g_world.GetGameMode())->scene || - !static_cast(g_world.GetGameMode())->scene->terrain) { + if (!g_modeMgr.GetGameMode() || !static_cast(g_modeMgr.GetGameMode())->scene || + !static_cast(g_modeMgr.GetGameMode())->scene->terrain) { return vector3d{0.0f, 0.0f, 0.0f}; } float x = 0.0f; float y = 0.0f; float z = 0.0f; - static_cast(g_world.GetGameMode())->scene->terrain->Grid().CellOrigin(column, row, x, z); - y = static_cast(g_world.GetGameMode())->scene->terrain->Grid().Height(x, z); + static_cast(g_modeMgr.GetGameMode())->scene->terrain->Grid().CellOrigin(column, row, x, z); + y = static_cast(g_modeMgr.GetGameMode())->scene->terrain->Grid().Height(x, z); return vector3d{x + 2.5f, y + 0.0f, z + 2.5f}; } diff --git a/Source/Contents/Sound/SoundMaker.cpp b/Source/Contents/Sound/SoundMaker.cpp index 322e3b51..2d2e8d95 100644 --- a/Source/Contents/Sound/SoundMaker.cpp +++ b/Source/Contents/Sound/SoundMaker.cpp @@ -5,9 +5,9 @@ #include "Contents/Actors/Npc.h" #include "Contents/Actors/Pc.h" #include "Contents/Sound/SoundMgr.h" -#include "Client/Mode/ActiveGameMode.h" +#include "Client/Mode/ModeMgr.h" #include "Client/Mode/CGameMode.h" -#include "Contents/World/WorldScene.h" +#include "Contents/World/World.h" #include "UI/Window/UIWindowMgr.h" #include "Resource/World/WorldResource.h" #include "Utility/Math/AffineMatrix.h" @@ -102,7 +102,7 @@ bool CSoundMaker::Update() { return true; } - const auto* player = reinterpret_cast(static_cast(g_world.GetGameMode())->scene->player); + const auto* player = reinterpret_cast(static_cast(g_modeMgr.GetGameMode())->scene->player); if (!player) { return true; } @@ -169,7 +169,7 @@ float* CPc::GetExtent(float* extent) const { // OFFSET: 0x00DA2FA0 // FUNCTION: fn_22397 bool CBlurPC::Update() { - WorldScene* scene = static_cast(g_world.GetGameMode())->scene; + CWorld* scene = static_cast(g_modeMgr.GetGameMode())->scene; if (scene) { const CRenderObject* owner = scene->GetGameActorByAidIncludeMe(this->render.accountId); if (owner && (owner->render.flags & 0x10) != 0) { @@ -189,7 +189,7 @@ bool CBlurPC::Update() { // OFFSET: 0x00DA3240 // FUNCTION: fn_22401 bool CHalluPC2::Update() { - WorldScene* scene = static_cast(g_world.GetGameMode())->scene; + CWorld* scene = static_cast(g_modeMgr.GetGameMode())->scene; if (scene) { const CRenderObject* owner = scene->GetGameActorByAidIncludeMe(this->render.accountId); if (owner && (owner->render.flags & 0x10) != 0) { diff --git a/Source/Contents/World/WorldScene.h b/Source/Contents/World/World.h similarity index 53% rename from Source/Contents/World/WorldScene.h rename to Source/Contents/World/World.h index 3e952513..a8cfa6b5 100644 --- a/Source/Contents/World/WorldScene.h +++ b/Source/Contents/World/World.h @@ -1,5 +1,5 @@ -#ifndef RAGNAROK_SOURCE_CONTENTS_WORLD_WORLDSCENE_H -#define RAGNAROK_SOURCE_CONTENTS_WORLD_WORLDSCENE_H +#ifndef RAGNAROK_SOURCE_CONTENTS_WORLD_WORLD_H +#define RAGNAROK_SOURCE_CONTENTS_WORLD_WORLD_H #include "Contents/World/WorldSpatialTree.h" @@ -16,12 +16,12 @@ class CPlayer; class CRenderObject; class GroundGeometry; -class WorldScene { +class CWorld { public: - WorldScene(); - virtual ~WorldScene(); - WorldScene(const WorldScene&) = delete; - WorldScene& operator=(const WorldScene&) = delete; + CWorld(); + virtual ~CWorld(); + CWorld(const CWorld&) = delete; + CWorld& operator=(const CWorld&) = delete; void Clear(); bool FindActorInCell(const float* position, std::function predicate) const; CRenderObject* GetGameActorByAID(std::uint32_t aid) const; @@ -59,28 +59,28 @@ public: CRenderObject* FindRenderObject(std::uint32_t aid); #if defined(_WIN32) && !defined(_WIN64) -static_assert(offsetof(WorldScene, gameMode) == 0x04); -static_assert(offsetof(WorldScene, objects) == 0x08); -static_assert(offsetof(WorldScene, actors) == 0x10); -static_assert(offsetof(WorldScene, unknown_0018) == 0x18); -static_assert(offsetof(WorldScene, unknown_0020) == 0x20); -static_assert(offsetof(WorldScene, ground) == 0x28); -static_assert(offsetof(WorldScene, player) == 0x2C); -static_assert(offsetof(WorldScene, terrain) == 0x30); -static_assert(offsetof(WorldScene, models) == 0x34); -static_assert(offsetof(WorldScene, published) == 0x40); -static_assert(offsetof(WorldScene, pending) == 0x44); -static_assert(offsetof(WorldScene, spatial) == 0x58); -static_assert(offsetof(WorldScene, serializedSpatial) == 0xD4); -static_assert(offsetof(WorldScene, pendingActorIds) == 0xD8); -static_assert(offsetof(WorldScene, movies) == 0xE0); -static_assert(offsetof(WorldScene, actorCells) == 0xE4); -static_assert(offsetof(WorldScene, unindexedActorIds) == 0xEC); -static_assert(offsetof(WorldScene, unknown_00F4) == 0xF4); -static_assert(offsetof(WorldScene, nearbyRange) == 0xF8); -static_assert(offsetof(WorldScene, unknown_00FC) == 0xFC); -static_assert(offsetof(WorldScene, unknown_00FD) == 0xFD); -static_assert(sizeof(WorldScene) == 0x100); +static_assert(offsetof(CWorld, gameMode) == 0x04); +static_assert(offsetof(CWorld, objects) == 0x08); +static_assert(offsetof(CWorld, actors) == 0x10); +static_assert(offsetof(CWorld, unknown_0018) == 0x18); +static_assert(offsetof(CWorld, unknown_0020) == 0x20); +static_assert(offsetof(CWorld, ground) == 0x28); +static_assert(offsetof(CWorld, player) == 0x2C); +static_assert(offsetof(CWorld, terrain) == 0x30); +static_assert(offsetof(CWorld, models) == 0x34); +static_assert(offsetof(CWorld, published) == 0x40); +static_assert(offsetof(CWorld, pending) == 0x44); +static_assert(offsetof(CWorld, spatial) == 0x58); +static_assert(offsetof(CWorld, serializedSpatial) == 0xD4); +static_assert(offsetof(CWorld, pendingActorIds) == 0xD8); +static_assert(offsetof(CWorld, movies) == 0xE0); +static_assert(offsetof(CWorld, actorCells) == 0xE4); +static_assert(offsetof(CWorld, unindexedActorIds) == 0xEC); +static_assert(offsetof(CWorld, unknown_00F4) == 0xF4); +static_assert(offsetof(CWorld, nearbyRange) == 0xF8); +static_assert(offsetof(CWorld, unknown_00FC) == 0xFC); +static_assert(offsetof(CWorld, unknown_00FD) == 0xFD); +static_assert(sizeof(CWorld) == 0x100); #endif #endif diff --git a/Source/Contents/World/WorldActors.cpp b/Source/Contents/World/WorldActors.cpp index 0a703ccd..21c57ce7 100644 --- a/Source/Contents/World/WorldActors.cpp +++ b/Source/Contents/World/WorldActors.cpp @@ -1,9 +1,9 @@ #include "Contents/Actors/RenderObject.h" -#include "Contents/World/WorldScene.h" +#include "Contents/World/World.h" // OFFSET: 0x00AC8260 // FUNCTION: fn_17668 -CRenderObject* WorldScene::GetGameActorByAID(std::uint32_t aid) const { +CRenderObject* CWorld::GetGameActorByAID(std::uint32_t aid) const { for (CRenderObject* actor : this->actors) { if (actor->render.accountId == aid) { return actor; diff --git a/Source/Contents/World/WorldObjects.cpp b/Source/Contents/World/WorldObjects.cpp index 9ad11ce5..4575f9e6 100644 --- a/Source/Contents/World/WorldObjects.cpp +++ b/Source/Contents/World/WorldObjects.cpp @@ -4,16 +4,16 @@ #include "Resource/ResourceMgr.h" #include "Contents/Actors/RenderObject.h" #include "Contents/Actors/Skill.h" -#include "Client/Mode/ActiveGameMode.h" +#include "Client/Mode/ModeMgr.h" #include "Contents/World/WorldObjects.h" -#include "Contents/World/WorldScene.h" +#include "Contents/World/World.h" #include "Contents/Effects/EffectLists.h" #include // OFFSET: 0x00AC8220 // FUNCTION: fn_17667 -CRenderObject* WorldScene::GetGameActorByAidIncludeMe(std::uint32_t aid) const { +CRenderObject* CWorld::GetGameActorByAidIncludeMe(std::uint32_t aid) const { if (aid == g_session.m_aid) { return reinterpret_cast(this->player); } @@ -44,7 +44,7 @@ EffectLists* g_effectMgr; // OFFSET: 0x00ACA320 // FUNCTION: fn_17691 -void WorldScene::Clear() { +void CWorld::Clear() { auto entry = this->objects.begin(); while (entry != this->objects.end()) { @@ -104,7 +104,7 @@ CCorpse* CGameMode::SpawnCorpse(float x, float y, float z, const char* action, c // OFFSET: 0x00AC8440 // FUNCTION: fn_17671 -CRenderObject* WorldScene::GetSkillByAID(std::uint32_t aid) const { +CRenderObject* CWorld::GetSkillByAID(std::uint32_t aid) const { for (CRenderObject* object : this->unknown_0020) { CSkill* skill = static_cast(object); @@ -119,7 +119,7 @@ CRenderObject* WorldScene::GetSkillByAID(std::uint32_t aid) const { // OFFSET: 0x00B3C350 // FUNCTION: fn_18807 CRenderObject* FindRenderObject(std::uint32_t aid) { - WorldScene* scene = static_cast(g_world.GetGameMode())->scene; + CWorld* scene = static_cast(g_modeMgr.GetGameMode())->scene; if (g_session.m_aid == aid) { return reinterpret_cast(scene->player); diff --git a/Source/Contents/World/WorldProximity.cpp b/Source/Contents/World/WorldProximity.cpp index 451c9b17..eed02a06 100644 --- a/Source/Contents/World/WorldProximity.cpp +++ b/Source/Contents/World/WorldProximity.cpp @@ -1,5 +1,5 @@ #include "Contents/World/WorldProximity.h" -#include "Contents/World/WorldScene.h" +#include "Contents/World/World.h" #include "Network/Connection/Connection.h" #include "Network/Packets/PacketLengths.h" #include "Resource/World/TerrainResource.h" @@ -35,7 +35,7 @@ void UpdateWorldProximityNotification( // OFFSET: 0x00AC8A40 // FUNCTION: fn_17678 -bool WorldScene::FindActorInCell(const float* position, std::function predicate) const { +bool CWorld::FindActorInCell(const float* position, std::function predicate) const { const float key = static_cast(this->terrain->width) * position[1] + position[0]; const auto found = this->actorCells.find(key); @@ -49,7 +49,7 @@ bool WorldScene::FindActorInCell(const float* position, std::functionactorCells.clear(); this->unindexedActorIds.clear(); } diff --git a/Source/Contents/World/WorldSpatialTree.cpp b/Source/Contents/World/WorldSpatialTree.cpp index 6220b542..96ff5ea3 100644 --- a/Source/Contents/World/WorldSpatialTree.cpp +++ b/Source/Contents/World/WorldSpatialTree.cpp @@ -3,14 +3,14 @@ #include "Contents/Ground/GroundSpatial.h" #include "Contents/Models/ModelActor.h" #include "Contents/Movies/BinkMovies.h" -#include "Contents/World/WorldScene.h" +#include "Contents/World/World.h" #include "Contents/World/WorldSpatialTree.h" #include "File/File.h" #include "Resource/World/TerrainResource.h" // OFFSET: 0x00AC64F0 // FUNCTION: fn_17651 -WorldScene::WorldScene() { +CWorld::CWorld() { this->unknown_00FD = false; this->serializedSpatial = nullptr; this->pending = 0; @@ -29,7 +29,7 @@ WorldScene::WorldScene() { // OFFSET: 0x00AC6FB0 // FUNCTION: fn_17654 -WorldScene::~WorldScene() { +CWorld::~CWorld() { delete this->ground; if (this->movies) { diff --git a/Source/Contents/WorldNavigation.cpp b/Source/Contents/WorldNavigation.cpp index 5e7f07c1..ba1019f8 100644 --- a/Source/Contents/WorldNavigation.cpp +++ b/Source/Contents/WorldNavigation.cpp @@ -1,9 +1,9 @@ -#include "Client/Mode/ActiveGameMode.h" +#include "Client/Mode/ModeMgr.h" #include "Client/Mode/CGameMode.h" #include "Contents/Actors/RenderObject.h" #include "Contents/NavigationManager.h" #include "Contents/TerrainPathSearch.h" -#include "Contents/World/WorldScene.h" +#include "Contents/World/World.h" #include #include @@ -11,7 +11,7 @@ // OFFSET: 0x00B961E0 // FUNCTION: fn_19581 bool CNavigationManager::PlayerCell(int* column, int* row) { - CGameMode* mode = static_cast(g_world.GetGameMode()); + CGameMode* mode = static_cast(g_modeMgr.GetGameMode()); if (mode == nullptr) { return false; } diff --git a/Source/Resource/TextureNames.cpp b/Source/Resource/TextureNames.cpp index c386d7d4..4241eee9 100644 --- a/Source/Resource/TextureNames.cpp +++ b/Source/Resource/TextureNames.cpp @@ -1,5 +1,5 @@ #include "Client/Input/InputCharset.h" -#include "Client/Mode/ActiveGameMode.h" +#include "Client/Mode/ModeMgr.h" #include "Contents/Configuration/ServiceConfiguration.h" #include "Contents/SkinMgr.h" #include "Resource/ResourceMgr.h" @@ -40,7 +40,7 @@ const char* Resolve(const char* name) { return name; } - if (g_world.gameMode && g_skinInfo.Selected()) { + if (g_modeMgr.gameMode && g_skinInfo.Selected()) { const std::string prefix(g_skinInfo.Prefix()); // STATIC: 0x016D58CC // GLOBAL: gl_24385 diff --git a/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp b/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp index 1acbbfbe..4c1e797e 100644 --- a/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp +++ b/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp @@ -4,7 +4,7 @@ #include "Client/Session.h" #include "Contents/Configuration/ServiceConfiguration.h" #include "Contents/MessageTable.h" -#include "Client/Mode/ActiveGameMode.h" +#include "Client/Mode/ModeMgr.h" #include "Client/Mode/CGameMode.h" #include "Client/Mode/ModeEvents.h" #include "Client/Replay.h" @@ -276,7 +276,7 @@ void UIMinimapZoomWnd::Paint() { this->ClearSurface(0xFFFF00FF); int column = 0; int row = 0; - static_cast(g_world.GetGameMode())->PlayerCell(&column, &row); + static_cast(g_modeMgr.GetGameMode())->PlayerCell(&column, &row); const std::string text = FormatOwnedString(" %d %d", column, row); this->DrawTextAt(controls.fonts, controls.locale, 19, 128, text.c_str(), 0, 0, 12, 0, 0, 0); this->DrawTextAt(controls.fonts, controls.locale, 20, 128, text.c_str(), 0, 0, 12, 0xFFFFFF, 0, 0); @@ -667,7 +667,7 @@ void UIPetTamingDeceiveWnd::Slot25(int, int) { this->m_state = 1; this->m_frame = 7; this->m_started = 1; - g_world.GetGameMode()->SendMsg(149, this->m_target, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(149, this->m_target, 0, 0, 0); } // OFFSET: 0x008EFB40 diff --git a/Source/UI/UILapineUpgradeBoxWnd.cpp b/Source/UI/UILapineUpgradeBoxWnd.cpp index 8d10831a..8bfdb062 100644 --- a/Source/UI/UILapineUpgradeBoxWnd.cpp +++ b/Source/UI/UILapineUpgradeBoxWnd.cpp @@ -1,6 +1,6 @@ #include "UI/UILapineUpgradeBoxWnd.h" -#include "Client/Mode/ActiveGameMode.h" +#include "Client/Mode/ModeMgr.h" #include "Client/Mode/CGameMode.h" #include "Client/Mode/ModeDragState.h" #include "Client/Mode/ModeEvents.h" @@ -65,7 +65,7 @@ void UILapineUpgradeBoxWnd::Slot25(int x, int y) { } if (static_cast(x - 101) <= 24 && static_cast(y - 165) <= 24 && this->item.unknown_0000[1] != 0) { ItemDescriptions descriptions{g_itemDescriptions}; - static_cast(g_world.GetGameMode())->drag.BeginItem(this->m_frameContext->windows, descriptions, 26, this->item, 1, -1); + static_cast(g_modeMgr.GetGameMode())->drag.BeginItem(this->m_frameContext->windows, descriptions, 26, this->item, 1, -1); } } @@ -74,7 +74,7 @@ void UILapineUpgradeBoxWnd::Slot25(int x, int y) { void UILapineUpgradeBox_IngredientInfoWnd::Slot25(int x, int y) { if (this->item.unknown_0000[1] != 0) { ItemDescriptions descriptions{g_itemDescriptions}; - static_cast(g_world.GetGameMode())->drag.BeginItem(this->m_frameContext->windows, descriptions, 27, this->item, this->quantity, -1); + static_cast(g_modeMgr.GetGameMode())->drag.BeginItem(this->m_frameContext->windows, descriptions, 27, this->item, this->quantity, -1); } } @@ -126,7 +126,7 @@ void UILapineUpgradeBoxWnd::SetWaiting(unsigned char value) { // OFFSET: 0x00603680 // FUNCTION: fn_04196 void UILapineUpgradeBox_IngredientListWnd::Slot10(int x, int y, std::intptr_t value) { - CMode* mode = g_world.GetGameMode(); + CMode* mode = g_modeMgr.GetGameMode(); const ModeDragState* drag = reinterpret_cast(value); if (drag->source == 26) { this->SendMsg(this, 31, drag->id, 0, 0, 0); diff --git a/Source/UI/Window/UIFrameWnd.cpp b/Source/UI/Window/UIFrameWnd.cpp index 3d8ff4e3..92d6c8a4 100644 --- a/Source/UI/Window/UIFrameWnd.cpp +++ b/Source/UI/Window/UIFrameWnd.cpp @@ -8,7 +8,7 @@ #include "UI/Text/UITextViewer.h" #include "UI/Window/UICntWnd.h" #include "UI/Window/UIMonsterInfoWnd.h" -#include "Client/Mode/ActiveGameMode.h" +#include "Client/Mode/ModeMgr.h" #include "Client/Mode/CGameMode.h" #include "Client/Mode/ModeEvents.h" #include "UI/Lists/UIReplayListBox.h" @@ -262,7 +262,7 @@ void UIMonsterInfoWnd::Slot28(int x, int y) { int screenX = 0; int screenY = 0; this->ToScreen(screenX, screenY); - std::string name = static_cast(g_world.GetGameMode())->nameCard.Name(g_monsterInfoActorId); + std::string name = static_cast(g_modeMgr.GetGameMode())->nameCard.Name(g_monsterInfoActorId); const std::size_t mark = name.find("#", 0); if (mark != std::string::npos) { name.erase(mark, name.size()); diff --git a/Source/UI/Window/UIMessageBox.cpp b/Source/UI/Window/UIMessageBox.cpp index b3a53980..bb1c8bb6 100644 --- a/Source/UI/Window/UIMessageBox.cpp +++ b/Source/UI/Window/UIMessageBox.cpp @@ -27,7 +27,7 @@ #include "UI/Window/UIHomunInfoWnd.h" #include "UI/Window/UIPetInfoWnd.h" #include "UI/Window/UIReplayRECControlWnd.h" -#include "Client/Mode/ActiveGameMode.h" +#include "Client/Mode/ModeMgr.h" #include "Client/Registry.h" #include "Utility/Cipher/XorBytes.h" #include "UI/Window/UILoginOTPWnd.h" @@ -604,7 +604,7 @@ int UITalkboxTrapInputWnd::SendMsg(UIWindow* sender, int message, std::intptr_t TalkboxTrapRequest request; request.target = this->target; request.text = this->edit->Text(); - g_world.GetGameMode()->SendMsg(131, reinterpret_cast(&request), 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(131, reinterpret_cast(&request), 0, 0, 0); } else if (a != 185) { return 0; } diff --git a/Source/UI/Window/UIWindowMgr.cpp b/Source/UI/Window/UIWindowMgr.cpp index acfb5022..ac558ba0 100644 --- a/Source/UI/Window/UIWindowMgr.cpp +++ b/Source/UI/Window/UIWindowMgr.cpp @@ -1,5 +1,5 @@ #include "Client/Browser/WebBrowser.h" -#include "Client/Mode/ActiveGameMode.h" +#include "Client/Mode/ModeMgr.h" #include "Client/Replay.h" #include "Contents/Configuration/ServiceConfiguration.h" #include "Contents/Configuration/ServiceOptions.h" @@ -465,7 +465,7 @@ void UIWindowMgr::ResetWindows() { this->window_01D0 = nullptr; this->unknown_0224 = 0; if (hadWindow0270) { - if (CMode* mode = g_world.GetGameMode()) { + if (CMode* mode = g_modeMgr.GetGameMode()) { mode->SendMsg(292, 0, 0, 0, 0); } } @@ -632,7 +632,7 @@ void UIWindowMgr::RegisterNamedWindow(std::string name, UIWindow* window) { // OFFSET: 0x00AA9B00 // FUNCTION: fn_17254 void UIWindowMgr::NotifyMode() { - if (CMode* mode = g_world.GetGameMode()) { + if (CMode* mode = g_modeMgr.GetGameMode()) { mode->SendMsg(292, 0, 0, 0, 0); } } diff --git a/data/compile.json b/data/compile.json index 776a430f..dd8eef9f 100644 --- a/data/compile.json +++ b/data/compile.json @@ -253,7 +253,7 @@ "Source/Client/Input/Mouse.cpp": 0, "Source/Client/Input/Language.cpp": 0, "Source/Client/Input/LanguageTC.cpp": 0, - "Source/Client/Mode/ActiveGameMode.cpp": 0, + "Source/Client/Mode/ModeMgr.cpp": 0, "Source/Client/Mode/ModeCursor.cpp": 0, "Source/Client/Mode/ModeDragState.cpp": 2, "Source/Client/Mode/ModeTooltip.cpp": 2,