diff --git a/addons/missileguidance/functions/fnc_onFired.sqf b/addons/missileguidance/functions/fnc_onFired.sqf index f044d8242c..1eb791a058 100644 --- a/addons/missileguidance/functions/fnc_onFired.sqf +++ b/addons/missileguidance/functions/fnc_onFired.sqf @@ -1,20 +1,21 @@ //#define DEBUG_MODE_FULL #include "script_component.hpp" +PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); + // Bail if guidance is disabled // Bail on locality of the projectile, it should be local to us if(GVAR(enabled) < 1 || {!local _projectile} ) exitWith { false }; +//Bail if shooter isn't player AND system not enabled for AI: if( !isPlayer _shooter && { GVAR(enabled) < 2 } ) exitWith { false }; -private["_config", "_configs", "_enabled", "_target", "_seekerType", "_attackProfile"]; -private["_args", "_canUseLock", "_guidingUnit", "_launchPos", "_lockMode", "_targetPos", "_vanillaTarget"]; - -PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); - // Bail on not missile if(! (_ammo isKindOf "MissileBase") ) exitWith { false }; +private["_config", "_configs", "_enabled", "_target", "_seekerType", "_attackProfile"]; +private["_args", "_canUseLock", "_guidingUnit", "_launchPos", "_lockMode", "_targetPos", "_vanillaTarget"]; + //Verify ammo has explicity added guidance config (ignore inheritances) _configs = configProperties [(configFile >> "CfgAmmo" >> _ammo), QUOTE(configName _x == QUOTE(QUOTE(ADDON))), false]; if( (count _configs) < 1) exitWith {};