From b2c9b1cc23ce542d3ec3089b56c9054633206d4c Mon Sep 17 00:00:00 2001 From: phobos2077 Date: Sat, 22 Jul 2023 03:29:31 +0200 Subject: [PATCH] HOOK_STEAL: add arg4 - quantity of items stolen --- artifacts/scripting/hooks.yml | 1 + artifacts/scripting/hookscripts.md | 1 + sfall/Modules/HookScripts/MiscHs.cpp | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/artifacts/scripting/hooks.yml b/artifacts/scripting/hooks.yml index 294ed09c..3c3f5886 100644 --- a/artifacts/scripting/hooks.yml +++ b/artifacts/scripting/hooks.yml @@ -375,6 +375,7 @@ Obj arg1 - The target Item arg2 - Item being stolen/planted int arg3 - 0 when stealing, 1 when planting + int arg4 - quantity of items being stolen int ret0 - overrides hard-coded handler (1 - force success, 0 - force fail, -1 - use engine handler) ``` diff --git a/artifacts/scripting/hookscripts.md b/artifacts/scripting/hookscripts.md index 70871f30..7d011563 100644 --- a/artifacts/scripting/hookscripts.md +++ b/artifacts/scripting/hookscripts.md @@ -478,6 +478,7 @@ Critter arg0 - Thief Obj arg1 - The target Item arg2 - Item being stolen/planted int arg3 - 0 when stealing, 1 when planting +int arg4 - quantity of items being stolen int ret0 - overrides hard-coded handler (1 - force success, 0 - force fail, -1 - use engine handler) ``` diff --git a/sfall/Modules/HookScripts/MiscHs.cpp b/sfall/Modules/HookScripts/MiscHs.cpp index 787e2ed9..54afa7c8 100644 --- a/sfall/Modules/HookScripts/MiscHs.cpp +++ b/sfall/Modules/HookScripts/MiscHs.cpp @@ -209,10 +209,11 @@ static void __declspec(naked) StealCheckHook() { mov args[4], edx; // target mov args[8], ebx; // item mov args[12], ecx; // is planting + mov args[16], esi; // quantity pushadc; } - argCount = 4; + argCount = 5; RunHookScript(HOOK_STEAL); __asm {