diff --git a/README.md b/README.md index a0ab13e2..e9a7d062 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,8 @@ Please note that you can build the hardened version only if you have access to i - Game speed slider toggle - Revert of Battle Fortress cloak changes for CnCNet YR - Ability to disable ingame chat +- **[Noble Fish](https://github.com/DeathFishAtEase)** + - Improve QuickExit so that the normal exit process also has the speed of Alt+F4 - **[TaranDahl](https://github.com/TaranDahl)** - Porting of multiplayer save/load - Porting of autosaves diff --git a/src/Misc/QuickExit.cpp b/src/Misc/QuickExit.cpp index b7319581..9dbae39c 100644 --- a/src/Misc/QuickExit.cpp +++ b/src/Misc/QuickExit.cpp @@ -50,3 +50,19 @@ DEFINE_HOOK(0x623125, OwnerDrawLoop_HandleRageQuit, 0x5) ? 0x623157 : 0; } + +DEFINE_HOOK(0x6BE091, WinMain_AfterGameLoop_HandleQuickExit, 0x6) +{ + if (Main::GetConfig()->QuickExit) + ExitProcess(0); + + return 0; +} + +DEFINE_HOOK(0x686570, DisconnectGracefully_HandleQuickExit, 0x5) +{ + if (Main::GetConfig()->QuickExit) + ExitProcess(0); + + return 0; +}