diff --git a/sfall/Modules/BugFixes.cpp b/sfall/Modules/BugFixes.cpp index b777bcdf2..bf9502b32 100644 --- a/sfall/Modules/BugFixes.cpp +++ b/sfall/Modules/BugFixes.cpp @@ -118,6 +118,24 @@ static void combat_ai_reset() { std::memcpy(caps, &aiCapsBackup[0], num_caps * sizeof(fo::AIcap)); } +static void __declspec(naked) GNW95_init_window_hack() { + __asm { + pop eax; + push 0x50FA0C; // "GNW95 Class" + push (WS_EX_TOPMOST | WS_EX_APPWINDOW); // was WS_EX_TOPMOST + jmp eax; + } +} + +static void __declspec(naked) GNW95_init_window_hack_HRP() { + __asm { + pop eax; + push 0x50FA0C; // "GNW95 Class" + push WS_EX_APPWINDOW; // was 0 + jmp eax; + } +} + // fix for vanilla negate operator not working on floats static void __declspec(naked) NegateFixHack() { static const DWORD NegateFixHack_Back = 0x46AB77; @@ -3410,6 +3428,13 @@ void BugFixes::init() { combat_ai_reset(); }; + // Fix for the game disappearing from the taskbar after using Alt+Tab + MakeCall(0x4CAF14, GNW95_init_window_hack, 2); + if (HRP::Setting::VersionIsValid) { // for HRP 4.1.8 in DD7/DX9 mode + MakeCall(HRP::Setting::GetAddress(0x10026504), GNW95_init_window_hack_HRP, 2); // windowed + MakeCall(HRP::Setting::GetAddress(0x10026605), GNW95_init_window_hack, 2); // fullscreen + } + // Fix vanilla negate operator for float values MakeCall(0x46AB68, NegateFixHack); diff --git a/sfall/Modules/Input.cpp b/sfall/Modules/Input.cpp index 7ce822642..4b8cc0927 100644 --- a/sfall/Modules/Input.cpp +++ b/sfall/Modules/Input.cpp @@ -30,7 +30,7 @@ namespace sfall void Input::init() { //if (IniReader::GetConfigInt("Input", "Enable", 0)) { dlogr("Applying input patch.", DL_INIT); - SafeWriteStr(0x50FB70, "ddraw.dll"); + SafeWrite32(0x4DE902, 0x50FB50); // "DDRAW.DLL" ::sfall::availableGlobalScriptTypes |= 1; //} } diff --git a/sfall/version.h b/sfall/version.h index 0cf6452eb..25ea8dc3c 100644 --- a/sfall/version.h +++ b/sfall/version.h @@ -25,6 +25,6 @@ #define VERSION_MAJOR 4 #define VERSION_MINOR 4 #define VERSION_BUILD 2 -#define VERSION_REV 0 +#define VERSION_REV 1 -#define VERSION_STRING "4.4.2" +#define VERSION_STRING "4.4.2.1"