diff --git a/addons/huntir/CfgAmmo.hpp b/addons/huntir/CfgAmmo.hpp index a9cd260d0f..8766795d9f 100644 --- a/addons/huntir/CfgAmmo.hpp +++ b/addons/huntir/CfgAmmo.hpp @@ -5,6 +5,9 @@ class CfgAmmo { lightColor[] = {0, 0, 0, 0}; smokeColor[] = {0, 0, 0, 0}; timeToLive = 6; + class Eventhandlers { + fired = QUOTE(call FUNC(handleFired)); + }; }; class ShellBase; diff --git a/addons/huntir/XEH_postInit.sqf b/addons/huntir/XEH_postInit.sqf index 1f6a39056b..c68252af3b 100644 --- a/addons/huntir/XEH_postInit.sqf +++ b/addons/huntir/XEH_postInit.sqf @@ -8,8 +8,4 @@ GVAR(cur_cam) = 0; GVAR(ROTATE) = 0; GVAR(ELEVAT) = 0.01; -// Register fire event handler -// Don't run for non players, as they are too dumb to launch huntirs anyway -["ace_firedPlayer", DFUNC(handleFired)] call CBA_fnc_addEventHandler; - ["ace_huntir", {!GETMVAR(GVAR(stop),true)}] call CBA_fnc_registerFeatureCamera; diff --git a/addons/huntir/functions/fnc_handleFired.sqf b/addons/huntir/functions/fnc_handleFired.sqf index d39be47b15..5c7c3aca63 100644 --- a/addons/huntir/functions/fnc_handleFired.sqf +++ b/addons/huntir/functions/fnc_handleFired.sqf @@ -16,12 +16,11 @@ * Public: No */ -//IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle", "_gunner", "_turret"]; -TRACE_10("firedEH:",_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile, _vehicle, _gunner, _turret); +params ["_unit", "", "", "", "", "", "_projectile"]; +TRACE_2("handleFired",_unit,_projectile); -if (_ammo != "F_HuntIR") exitWith {}; - -if (!hasInterface) exitWith {}; +// Don't run for non players, as they are too dumb to launch huntirs anyway +if (_unit != ACE_player) exitWith {}; [{ params ["_projectile"];