diff --git a/artifacts/scripting/sfall function notes.txt b/artifacts/scripting/sfall function notes.txt index a9d5e817..c9f0aa7c 100644 --- a/artifacts/scripting/sfall function notes.txt +++ b/artifacts/scripting/sfall function notes.txt @@ -157,7 +157,7 @@ array - array ID to be used with array-related functions (actually an integer) - if you add 0x80000000 to the sid when calling set_script, map_enter_p_proc will be SKIPPED. The start proc will always be run. > int get_script(object) -- accepts a pointer to an object and returns it's scriptID (line number in scripts.lst), or -1 if the object is unscripted. +- accepts a pointer to an object and returns its scriptID (line number in scripts.lst), or -1 if the object is unscripted. > void set_self(int obj) - overrides the scripts self_obj for the next function call. @@ -214,7 +214,7 @@ Some additional reg_anim_* functions were introduced. They all work in the same - plays "take out weapon" animation for given holdFrameID. It is not required to have such weapon in critter's inventory. > void reg_anim_turn_towards(object, tile/target, delay) -- makes object change it's direction to face given tile num or target object. +- makes object change its direction to face given tile num or target object. > int metarule2_explosions(int arg1, int arg2) was made as a dirty easy hack to allow dynamically change some explosion parameters (ranged attack). All changed parameters are reset to vanilla state automatically after each attack action. Following macros are available in sfall.h: @@ -470,9 +470,12 @@ Some utility/math functions are available: - The time interval will be reset each time the player reloads the game > void sfall_func1("set_rest_mode", int mode) -- sets the bit flags for the rest mode (see REST_* constants in sfall.h) +- sets the bit flags for the rest mode (see RESTMODE_* constants in sfall.h) - passing 0 will reset the rest mode. It will also be reset each time the player reloads the game +> int sfall_func0("attack_is_aimed") +- returns 1 if the aimed attack mode is selected, 0 otherwise + ------------------------ ------ MORE INFO ------- ------------------------ diff --git a/sfall/Modules/Scripting/Handlers/Misc.cpp b/sfall/Modules/Scripting/Handlers/Misc.cpp index d9619246..82da5c0b 100644 --- a/sfall/Modules/Scripting/Handlers/Misc.cpp +++ b/sfall/Modules/Scripting/Handlers/Misc.cpp @@ -1391,7 +1391,7 @@ void __declspec(naked) op_refresh_pc_art() { } } -void _stdcall intf_attack_type() { +static void _stdcall intface_attack_type() { __asm { sub esp, 8; lea edx, [esp]; @@ -1407,10 +1407,11 @@ void __declspec(naked) op_get_attack_type() { push edx; push ecx; push eax; - call intf_attack_type; + call intface_attack_type; mov edx, ecx; // hit_mode test eax, eax; jz skip; + // get reload cmp ds:[FO_VAR_interfaceWindow], eax; jz end; mov ecx, ds:[FO_VAR_itemCurrentItem]; // 0 - left, 1 - right @@ -1742,7 +1743,7 @@ end: void sf_attack_is_aimed(OpcodeContext& ctx) { int is_secondary, result; __asm { - call intf_attack_type; + call intface_attack_type; mov result, eax; mov is_secondary, edx; } diff --git a/sfall/Modules/Scripting/Handlers/Misc.h b/sfall/Modules/Scripting/Handlers/Misc.h index 13099c78..6a9d8d5f 100644 --- a/sfall/Modules/Scripting/Handlers/Misc.h +++ b/sfall/Modules/Scripting/Handlers/Misc.h @@ -29,8 +29,6 @@ namespace script class OpcodeContext; -void _stdcall intf_attack_type(); - // TODO: rewrite all op_* functions using OpcodeContext void __declspec() op_set_dm_model();