mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Fixed calls BeginHook() procedures.
This commit is contained in:
@@ -211,8 +211,8 @@ static void __fastcall GlobalVarHookScript(DWORD number, int value) {
|
||||
static void __declspec(naked) SetGlobalVarHook() {
|
||||
__asm {
|
||||
pushad;
|
||||
mov ecx, eax; // number
|
||||
call GlobalVarHookScript; // edx value
|
||||
mov ecx, eax; // number
|
||||
call GlobalVarHookScript; // edx - value
|
||||
popad;
|
||||
cmp cRet, 1;
|
||||
cmovae edx, dword ptr rets[0];
|
||||
@@ -225,12 +225,12 @@ static void _stdcall RestTimerHookScript() {
|
||||
DWORD addrHook;
|
||||
__asm {
|
||||
mov addrHook, ebx;
|
||||
HookBegin;
|
||||
mov args[0], eax;
|
||||
mov args[8], ecx;
|
||||
mov args[12], edx;
|
||||
}
|
||||
|
||||
BeginHook();
|
||||
argCount = 4;
|
||||
addrHook -= 5;
|
||||
if (addrHook == 0x499CA1 || addrHook == 0x499B63) {
|
||||
|
||||
@@ -76,30 +76,34 @@ end:
|
||||
}
|
||||
}
|
||||
|
||||
static void __fastcall UseAnimateObjHook_Script(DWORD critter, DWORD animCode, DWORD object) {
|
||||
|
||||
BeginHook();
|
||||
argCount = 3;
|
||||
|
||||
args[0] = critter;
|
||||
args[1] = object;
|
||||
args[2] = animCode;
|
||||
|
||||
RunHookScript(HOOK_USEANIMOBJ);
|
||||
EndHook();
|
||||
|
||||
if (cRet > 0 && static_cast<long>(rets[0]) > 64) cRet = 0;
|
||||
}
|
||||
|
||||
// Before animation of using map object
|
||||
static void __declspec(naked) UseAnimateObjHook() {
|
||||
__asm {
|
||||
mov args[0], eax; // source critter
|
||||
mov args[8], edx; // anim code
|
||||
//
|
||||
cmp dword ptr [esp], 0x412292 + 5;
|
||||
pushad;
|
||||
jne contr;
|
||||
mov args[4], ebp; // map object
|
||||
push ebp; // map object
|
||||
jmp next;
|
||||
contr:
|
||||
mov args[4], edi;
|
||||
push edi; // map object
|
||||
next:
|
||||
pushad;
|
||||
}
|
||||
|
||||
BeginHook();
|
||||
argCount = 3;
|
||||
RunHookScript(HOOK_USEANIMOBJ);
|
||||
EndHook();
|
||||
|
||||
if (cRet > 0 && static_cast<long>(rets[0]) > 64) cRet = 0;
|
||||
|
||||
__asm {
|
||||
mov ecx, eax; // source critter
|
||||
call UseAnimateObjHook_Script; // edx - anim code
|
||||
popad;
|
||||
cmp cRet, 0;
|
||||
jle skip;
|
||||
|
||||
Reference in New Issue
Block a user