This commit is contained in:
Diavolo 2021-07-18 20:51:33 +02:00
parent b5976ff20a
commit 97032e9d46
4 changed files with 5 additions and 11 deletions

View File

@ -844,7 +844,7 @@ namespace Components
Command::Add("quit", [](Command::Params*) Command::Add("quit", [](Command::Params*)
{ {
ZoneBuilder::Quit(); Game::Com_Quitf_t();
}); });
Command::Add("error", [](Command::Params*) Command::Add("error", [](Command::Params*)
@ -921,12 +921,6 @@ namespace Components
return 0; return 0;
} }
void ZoneBuilder::Quit()
{
//TerminateProcess(GetCurrentProcess(), 0);
ExitProcess(0);
}
void ZoneBuilder::HandleError(int level, const char* format, ...) void ZoneBuilder::HandleError(int level, const char* format, ...)
{ {
char buffer[256] = { 0 }; char buffer[256] = { 0 };
@ -1088,9 +1082,6 @@ namespace Components
// set new entry point // set new entry point
Utils::Hook(0x4513DA, ZoneBuilder::EntryPoint, HOOK_JUMP).install()->quick(); Utils::Hook(0x4513DA, ZoneBuilder::EntryPoint, HOOK_JUMP).install()->quick();
// set quit handler
Utils::Hook(0x4D4000, ZoneBuilder::Quit, HOOK_JUMP).install()->quick();
// handle com_error calls // handle com_error calls
Utils::Hook(0x4B22D0, ZoneBuilder::HandleError, HOOK_JUMP).install()->quick(); Utils::Hook(0x4B22D0, ZoneBuilder::HandleError, HOOK_JUMP).install()->quick();

View File

@ -138,7 +138,6 @@ namespace Components
static std::string FindMaterialByTechnique(const std::string& name); static std::string FindMaterialByTechnique(const std::string& name);
static int __stdcall EntryPoint(HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/, LPSTR /*lpCmdLine*/, int /*nShowCmd*/); static int __stdcall EntryPoint(HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/, LPSTR /*lpCmdLine*/, int /*nShowCmd*/);
static void Quit();
static void HandleError(int level, const char* format, ...); static void HandleError(int level, const char* format, ...);
static void SoftErrorAssetOverflow(); static void SoftErrorAssetOverflow();

View File

@ -65,6 +65,7 @@ namespace Game
Com_Parse_t Com_Parse = Com_Parse_t(0x474D60); Com_Parse_t Com_Parse = Com_Parse_t(0x474D60);
Com_MatchToken_t Com_MatchToken = Com_MatchToken_t(0x447130); Com_MatchToken_t Com_MatchToken = Com_MatchToken_t(0x447130);
Com_SetSlowMotion_t Com_SetSlowMotion = Com_SetSlowMotion_t(0x446E20); Com_SetSlowMotion_t Com_SetSlowMotion = Com_SetSlowMotion_t(0x446E20);
Com_Quitf_t Com_Quit_f = Com_Quitf_t(0x4D4000);
Con_DrawMiniConsole_t Con_DrawMiniConsole = Con_DrawMiniConsole_t(0x464F30); Con_DrawMiniConsole_t Con_DrawMiniConsole = Con_DrawMiniConsole_t(0x464F30);
Con_DrawSolidConsole_t Con_DrawSolidConsole = Con_DrawSolidConsole_t(0x5A5040); Con_DrawSolidConsole_t Con_DrawSolidConsole = Con_DrawSolidConsole_t(0x5A5040);

View File

@ -130,6 +130,9 @@ namespace Game
typedef void(__cdecl * Com_SetSlowMotion_t)(float start, float end, int duration); typedef void(__cdecl * Com_SetSlowMotion_t)(float start, float end, int duration);
extern Com_SetSlowMotion_t Com_SetSlowMotion; extern Com_SetSlowMotion_t Com_SetSlowMotion;
typedef void(__cdecl * Com_Quitf_t)();
extern Com_Quitf_t Com_Quit_f;
typedef char* (__cdecl * Con_DrawMiniConsole_t)(int localClientNum, int xPos, int yPos, float alpha); typedef char* (__cdecl * Con_DrawMiniConsole_t)(int localClientNum, int xPos, int yPos, float alpha);
extern Con_DrawMiniConsole_t Con_DrawMiniConsole; extern Con_DrawMiniConsole_t Con_DrawMiniConsole;