Terminate when closing the external console

This commit is contained in:
momo5502 2022-05-31 19:00:57 +02:00
parent 5546cca0e7
commit 17b28d7546

View File

@ -23,6 +23,16 @@ namespace console
} }
} }
void execute_command(const char* command)
{
reinterpret_cast<void(*)(int, const char*, ...)>(0x1420EC8B0_g)(0, command);
}
void terminate_game()
{
execute_command("quit\n");
}
void print_stub(const char* fmt, ...) void print_stub(const char* fmt, ...)
{ {
va_list ap; va_list ap;
@ -68,6 +78,11 @@ namespace console
{ {
TranslateMessage(&msg); TranslateMessage(&msg);
DispatchMessageW(&msg); DispatchMessageW(&msg);
if(msg.message == WM_QUIT)
{
terminate_game();
}
} }
else else
{ {