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() {
|
static void __declspec(naked) SetGlobalVarHook() {
|
||||||
__asm {
|
__asm {
|
||||||
pushad;
|
pushad;
|
||||||
mov ecx, eax; // number
|
mov ecx, eax; // number
|
||||||
call GlobalVarHookScript; // edx value
|
call GlobalVarHookScript; // edx - value
|
||||||
popad;
|
popad;
|
||||||
cmp cRet, 1;
|
cmp cRet, 1;
|
||||||
cmovae edx, dword ptr rets[0];
|
cmovae edx, dword ptr rets[0];
|
||||||
@@ -225,12 +225,12 @@ static void _stdcall RestTimerHookScript() {
|
|||||||
DWORD addrHook;
|
DWORD addrHook;
|
||||||
__asm {
|
__asm {
|
||||||
mov addrHook, ebx;
|
mov addrHook, ebx;
|
||||||
|
HookBegin;
|
||||||
mov args[0], eax;
|
mov args[0], eax;
|
||||||
mov args[8], ecx;
|
mov args[8], ecx;
|
||||||
mov args[12], edx;
|
mov args[12], edx;
|
||||||
}
|
}
|
||||||
|
|
||||||
BeginHook();
|
|
||||||
argCount = 4;
|
argCount = 4;
|
||||||
addrHook -= 5;
|
addrHook -= 5;
|
||||||
if (addrHook == 0x499CA1 || addrHook == 0x499B63) {
|
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
|
// Before animation of using map object
|
||||||
static void __declspec(naked) UseAnimateObjHook() {
|
static void __declspec(naked) UseAnimateObjHook() {
|
||||||
__asm {
|
__asm {
|
||||||
mov args[0], eax; // source critter
|
|
||||||
mov args[8], edx; // anim code
|
|
||||||
//
|
|
||||||
cmp dword ptr [esp], 0x412292 + 5;
|
cmp dword ptr [esp], 0x412292 + 5;
|
||||||
|
pushad;
|
||||||
jne contr;
|
jne contr;
|
||||||
mov args[4], ebp; // map object
|
push ebp; // map object
|
||||||
jmp next;
|
jmp next;
|
||||||
contr:
|
contr:
|
||||||
mov args[4], edi;
|
push edi; // map object
|
||||||
next:
|
next:
|
||||||
pushad;
|
mov ecx, eax; // source critter
|
||||||
}
|
call UseAnimateObjHook_Script; // edx - anim code
|
||||||
|
|
||||||
BeginHook();
|
|
||||||
argCount = 3;
|
|
||||||
RunHookScript(HOOK_USEANIMOBJ);
|
|
||||||
EndHook();
|
|
||||||
|
|
||||||
if (cRet > 0 && static_cast<long>(rets[0]) > 64) cRet = 0;
|
|
||||||
|
|
||||||
__asm {
|
|
||||||
popad;
|
popad;
|
||||||
cmp cRet, 0;
|
cmp cRet, 0;
|
||||||
jle skip;
|
jle skip;
|
||||||
|
|||||||
Reference in New Issue
Block a user