mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Fixed the "Leave" event of the window region
* the event procedure was not triggered when the cursor moves to a non-scripted window.
This commit is contained in:
@@ -2835,6 +2835,37 @@ skip:
|
||||
}
|
||||
}
|
||||
|
||||
static BYTE fixRegion = 0;
|
||||
|
||||
static void __declspec(naked) checkAllRegions_hack() {
|
||||
static const DWORD checkAllRegions_BackRet = 0x4B6C40;
|
||||
static const DWORD checkAllRegions_FixRet = 0x4B6AAB;
|
||||
__asm {
|
||||
test eax, eax;
|
||||
jnz skip;
|
||||
cmp dword ptr ds:[FO_VAR_lastWin], -1;
|
||||
je skip;
|
||||
mov fixRegion, 1;
|
||||
jmp checkAllRegions_FixRet; // trigger the leave event for _lastWin
|
||||
skip:
|
||||
add esp, 0x10;
|
||||
pop ebp;
|
||||
pop edi;
|
||||
jmp checkAllRegions_BackRet;
|
||||
}
|
||||
}
|
||||
|
||||
static void __declspec(naked) checkAllRegions_hook() {
|
||||
__asm {
|
||||
test byte ptr fixRegion, 1;
|
||||
jnz skip;
|
||||
jmp windowCheckRegion_;
|
||||
skip:
|
||||
mov fixRegion, 0;
|
||||
retn;
|
||||
}
|
||||
}
|
||||
|
||||
void BugFixes_OnGameLoad() {
|
||||
dudeIsAnimDeath = false;
|
||||
}
|
||||
@@ -3596,4 +3627,8 @@ void BugFixes_Init()
|
||||
// Fix for the flags of non-door objects being set/unset when using obj_close/open functions
|
||||
MakeCall(0x49CBF7, check_door_state_hack_close, 2);
|
||||
MakeCall(0x49CB30, check_door_state_hack_open, 1);
|
||||
|
||||
// Fix the "Leave" event procedure of the window region not being triggered when the cursor moves to a non-scripted window
|
||||
MakeJump(0x4B6C3B, checkAllRegions_hack);
|
||||
HookCall(0x4B6C13, checkAllRegions_hook);
|
||||
}
|
||||
|
||||
@@ -157,6 +157,7 @@
|
||||
#define FO_VAR_last_level 0x5707B4
|
||||
#define FO_VAR_lastMovieH 0x638E64
|
||||
#define FO_VAR_lastMovieW 0x638E68
|
||||
#define FO_VAR_lastWin 0x51DD80
|
||||
#define FO_VAR_Level_ 0x6681B0
|
||||
#define FO_VAR_Lifegiver 0x570854
|
||||
#define FO_VAR_lips_draw_head 0x519248
|
||||
|
||||
Reference in New Issue
Block a user