diff --git a/Source/Client/Mode/ActiveGameMode.h b/Source/Client/Mode/ActiveGameMode.h index d4c37aa4..88e767b5 100644 --- a/Source/Client/Mode/ActiveGameMode.h +++ b/Source/Client/Mode/ActiveGameMode.h @@ -6,10 +6,14 @@ struct CWorld { /* 0000 */ int running; /* 0004 */ CMode* gameMode; - /* 0008 */ unsigned char unknown_0008[0x50]; + /* 0008 */ unsigned char unknown_0008[0x28]; + /* 0030 */ char nextModeName[0x28]; /* 0058 */ int state; + /* 005C */ int nextState; CMode* ActiveGameMode(); + void Quit(); + void Switch(int mode, const char* name); }; extern CWorld g_world; diff --git a/Source/Client/ModeTransitions.cpp b/Source/Client/ModeTransitions.cpp new file mode 100644 index 00000000..019e889f --- /dev/null +++ b/Source/Client/ModeTransitions.cpp @@ -0,0 +1,27 @@ +#include "Client/Application/ApplicationWindow.h" +#include "Client/Mode/ActiveGameMode.h" +#include "Contents/Configuration/ServiceConfiguration.h" + +#include +#include + +// OFFSET: 0x00AD67E0 +// FUNCTION: fn_17845 +void CWorld::Quit() { + if (this->gameMode) { + this->gameMode->running = 0; + } + + if (g_serviceType == 11) { + ShellExecuteA(hWnd, "open", "http://www.ragnarok.co.in/index.php", nullptr, nullptr, SW_SHOWNORMAL); + } + this->running = 0; +} + +// OFFSET: 0x00AD7620 +// FUNCTION: fn_17851 +void CWorld::Switch(int mode, const char* name) { + this->gameMode->running = 0; + std::strcpy(this->nextModeName, name); + this->nextState = mode; +} diff --git a/data/compile.json b/data/compile.json index affd49c9..fad499c9 100644 --- a/data/compile.json +++ b/data/compile.json @@ -260,6 +260,7 @@ "Source/Client/ModeBaseEvents.cpp": 0, "Source/Client/ModeFade.cpp": 0, "Source/Client/ModeFadeOut.cpp": 0, + "Source/Client/ModeTransitions.cpp": 0, "Source/Client/Registry.cpp": 0, "Source/Client/Replay.cpp": 0, "Source/Client/ReplayControl.cpp": 0,