diff --git a/artifacts/scripting/headers/sfall.h b/artifacts/scripting/headers/sfall.h index ce3e6eaf4..eacee9970 100644 --- a/artifacts/scripting/headers/sfall.h +++ b/artifacts/scripting/headers/sfall.h @@ -76,7 +76,8 @@ #define HOOK_ROLLCHECK (46) #define HOOK_BESTWEAPON (47) #define HOOK_CANUSEWEAPON (48) -#define HOOK_BUILDSFXNAME (57) +// RESERVED 49..60 +#define HOOK_BUILDSFXWEAPON (61) // Valid arguments to list_begin #define LIST_CRITTERS (0) diff --git a/sfall/Modules/HookScripts.cpp b/sfall/Modules/HookScripts.cpp index 1925159cd..2dd422c04 100644 --- a/sfall/Modules/HookScripts.cpp +++ b/sfall/Modules/HookScripts.cpp @@ -113,13 +113,17 @@ static HooksInjectInfo injectHooks[] = { {HOOK_CANUSEWEAPON, Inject_CanUseWeaponHook, 0}, {-1}, // RESERVED {-1}, // RESERVED + {-1}, // HOOK_MOUSEWHEEL {-1}, // RESERVED {-1}, // RESERVED {-1}, // RESERVED + {-1}, // HOOK_COMBATATTACK {-1}, // RESERVED {-1}, // RESERVED {-1}, // RESERVED - {HOOK_BUILDSFXNAME, Inject_BuildSfxNameHook, 0}, + {-1}, // RESERVED + {-1}, // RESERVED + {HOOK_BUILDSFXWEAPON, Inject_BuildSfxWeaponHook, 0}, }; void HookScripts::InjectingHook(int hookId) { diff --git a/sfall/Modules/HookScripts.h b/sfall/Modules/HookScripts.h index 498898121..d184fe042 100644 --- a/sfall/Modules/HookScripts.h +++ b/sfall/Modules/HookScripts.h @@ -75,8 +75,8 @@ enum HookType HOOK_ROLLCHECK = 46, HOOK_BESTWEAPON = 47, HOOK_CANUSEWEAPON = 48, - // RESERVED 49 to 56 - HOOK_BUILDSFXNAME = 57, + // RESERVED 49 to 60 + HOOK_BUILDSFXWEAPON = 61, HOOK_COUNT }; diff --git a/sfall/Modules/HookScripts/SoundHs.cpp b/sfall/Modules/HookScripts/SoundHs.cpp index 3fc060b5a..094d70aa6 100644 --- a/sfall/Modules/HookScripts/SoundHs.cpp +++ b/sfall/Modules/HookScripts/SoundHs.cpp @@ -14,15 +14,14 @@ namespace sfall static DWORD __fastcall BuildSfxNameHook_Script(long effectType, fo::GameObject* weapon, long hitMode, fo::GameObject* target) { BeginHook(); allowNonIntReturn = true; - argCount = 5; + argCount = 4; - args[0] = 1; // weapon_sfx - args[1] = effectType; - args[2] = (DWORD)weapon; - args[3] = (DWORD)hitMode; - args[4] = (DWORD)target; + args[0] = effectType; + args[1] = (DWORD)weapon; + args[2] = (DWORD)hitMode; + args[3] = (DWORD)target; - RunHookScript(HOOK_BUILDSFXNAME); + RunHookScript(HOOK_BUILDSFXWEAPON); DWORD textPtr = cRet > 0 && retTypes[0] == DataType::STR ? rets[0] @@ -55,7 +54,7 @@ static __declspec(naked) void gsnd_build_weapon_sfx_name_hook() { } -void Inject_BuildSfxNameHook() { +void Inject_BuildSfxWeaponHook() { HookCalls(gsnd_build_weapon_sfx_name_hook, { 0x410DB3, // show_damage_to_object 0x411397, 0x411538, // action_melee @@ -70,7 +69,7 @@ void Inject_BuildSfxNameHook() { } void InitSoundHookScripts() { - HookScripts::LoadHookScript("hs_buildsfxname", HOOK_BUILDSFXNAME); + HookScripts::LoadHookScript("hs_buildsfxweapon", HOOK_BUILDSFXWEAPON); } } diff --git a/sfall/Modules/HookScripts/SoundHs.h b/sfall/Modules/HookScripts/SoundHs.h index a3d9234fc..27aa0b7ff 100644 --- a/sfall/Modules/HookScripts/SoundHs.h +++ b/sfall/Modules/HookScripts/SoundHs.h @@ -5,6 +5,6 @@ namespace sfall void InitSoundHookScripts(); -void Inject_BuildSfxNameHook(); +void Inject_BuildSfxWeaponHook(); }