From e23c2245352958c5bce719fd22634708aaffeec9 Mon Sep 17 00:00:00 2001 From: NovaRain Date: Thu, 12 Sep 2019 19:38:30 +0800 Subject: [PATCH] Excluded timed_event_p_proc from HOOK_STDPROCEDURE --- artifacts/scripting/hookscripts.txt | 7 ++++--- sfall/Modules/HookScripts/ObjectHs.cpp | 2 ++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/artifacts/scripting/hookscripts.txt b/artifacts/scripting/hookscripts.txt index 816fc29a..1da5b112 100644 --- a/artifacts/scripting/hookscripts.txt +++ b/artifacts/scripting/hookscripts.txt @@ -633,10 +633,11 @@ int ret2 - overrides the duration time for the current result HOOK_STDPROCEDURE (hs_stdprocedure.int) -Runs once every time before executing the standard procedure (handler) in the script of an object. +Runs before Fallout executes a standard procedure (handler) in any script of any object. +NOTE: this hook will not be executed for "start", critter_p_proc, timed_event_p_proc, and map_update_p_proc procedures. -int arg1 - number of the standard script handler (see define.h, except: start, critter_p_proc, and map_update_p_proc) -Obj arg2 - the object connected to the executed script (self_obj) +int arg1 - the number of the standard script handler (see define.h) +Obj arg2 - the object that owns this handler (self_obj) Obj arg3 - the object that called this handler (source_obj, can be 0) int ret1 - pass -1 to cancel the execution of the handler diff --git a/sfall/Modules/HookScripts/ObjectHs.cpp b/sfall/Modules/HookScripts/ObjectHs.cpp index a54a8d17..edc05be0 100644 --- a/sfall/Modules/HookScripts/ObjectHs.cpp +++ b/sfall/Modules/HookScripts/ObjectHs.cpp @@ -260,6 +260,8 @@ static void __declspec(naked) ScriptStdProcedureHook() { jle end; cmp ecx, critter_p_proc; je skip; + cmp ecx, timed_event_p_proc; + je skip; cmp ecx, map_update_p_proc; je skip; cmp ecx, start;