diff --git a/addons/spike/CfgAmmo.hpp b/addons/spike/CfgAmmo.hpp index e1e15812d2..9b1793ba68 100644 --- a/addons/spike/CfgAmmo.hpp +++ b/addons/spike/CfgAmmo.hpp @@ -35,6 +35,8 @@ class CfgAmmo { attackProfiles[] = {"DIR"}; useModeForAttackProfile = 0; + onFired = QFUNC(onFired); + class navigationStates { class initial { transitionCondition = QFUNC(midCourseTransition); diff --git a/addons/spike/CfgEventHandlers.hpp b/addons/spike/CfgEventHandlers.hpp index c3840c6d28..35dcb3a029 100644 --- a/addons/spike/CfgEventHandlers.hpp +++ b/addons/spike/CfgEventHandlers.hpp @@ -16,9 +16,3 @@ class Extended_PostInit_EventHandlers { }; }; -class Extended_FiredBIS_EventHandlers { - class All { - ADDON = QUOTE(_this call FUNC(onFired)); - }; -}; - diff --git a/addons/spike/functions/fnc_keyDown.sqf b/addons/spike/functions/fnc_keyDown.sqf index 0f18272281..0ca8235858 100644 --- a/addons/spike/functions/fnc_keyDown.sqf +++ b/addons/spike/functions/fnc_keyDown.sqf @@ -17,6 +17,8 @@ */ params ["_key", "_down"]; +if ((currentWeapon ACE_PLAYER) != QGVAR(launcher)) exitWith {}; + if (_key == SPIKE_KEY_DESIGNATE) then { if (cameraView == "GUNNER") then { playSound "ACE_Sound_Click"; diff --git a/addons/spike/functions/fnc_onFired.sqf b/addons/spike/functions/fnc_onFired.sqf index 6cd85a69d4..a5282b70d8 100644 --- a/addons/spike/functions/fnc_onFired.sqf +++ b/addons/spike/functions/fnc_onFired.sqf @@ -15,7 +15,8 @@ * * Public: No */ -params ["_shooter","_weapon","","_mode","_ammo","","_projectile"]; +params ["_firedEH"]; +_firedEH params ["_shooter","_weapon","","_mode","_ammo","","_projectile"]; private _missileGuidanceConfig = (configOf _projectile) >> "ace_missileguidance"; // Setup camera array @@ -86,4 +87,4 @@ GVAR(projectileHashMap) set [hashValue _projectile, [_camera, _preTarget]]; [_cameraArray, _projectile, CBA_missionTime - _lastUpdate, _camera] call FUNC(camera_update); _args set [2, CBA_missionTime]; -}, 0, [_this, _cameraArray, CBA_missionTime, _camera, hashValue _projectile]] call CBA_fnc_addPerFrameHandler; +}, 0, [_firedEH, _cameraArray, CBA_missionTime, _camera, hashValue _projectile]] call CBA_fnc_addPerFrameHandler;