diff --git a/addons/zeus/functions/fnc_artyAirburst.sqf b/addons/zeus/functions/fnc_artyAirburst.sqf index 875c6f9..80908e2 100644 --- a/addons/zeus/functions/fnc_artyAirburst.sqf +++ b/addons/zeus/functions/fnc_artyAirburst.sqf @@ -3,7 +3,7 @@ * Author: Timi007 * * Description: - * Detonates given shell at detonation hight for airburst effect. + * Detonates given shell at detonation hight for airburst effect. Needs to be executed on the server. * * Parameter(s): * 0: OBJECT - Artillery shell @@ -19,19 +19,21 @@ params ["_projectile", "_detonationHight"]; +CHECK(!isServer); + [{ params ["_argsArray", "_PFHID"]; _argsArray params ["_projectile", "_detonationHight"]; - if (((getPosATL _projectile) select 2) < _detonationHight) then { - if (isServer) then { - //give projectile shrapnels - [getPosATL _projectile, velocity _projectile, "Sh_155mm_AMOS"] call ace_frag_fnc_frago; - }; - _projectile setvelocity [0,0,0]; - "HelicopterExploSmall" createVehicle (getPosATL _projectile); + private _projectilePos = getPosATL _projectile; + if ((_projectilePos select 2) < _detonationHight) exitWith { + // give projectile shrapnels + [_projectilePos, velocity _projectile, "Sh_155mm_AMOS"] call ace_frag_fnc_frago; + + _projectile setVelocity [0,0,0]; + "HelicopterExploSmall" createVehicle _projectilePos; deleteVehicle _projectile; [_PFHID] call CBA_fnc_removePerFrameHandler; }; -}, 0, [_projectile, _detonationHight]] call CBA_fnc_addPerFrameHandler; +}, 0, _this] call CBA_fnc_addPerFrameHandler; diff --git a/addons/zeus/functions/fnc_execArtyStrike.sqf b/addons/zeus/functions/fnc_execArtyStrike.sqf index 68d0c97..1f4f73b 100644 --- a/addons/zeus/functions/fnc_execArtyStrike.sqf +++ b/addons/zeus/functions/fnc_execArtyStrike.sqf @@ -84,12 +84,12 @@ for "_i" from 0 to (_ammoAmount - 1) do { params ["_ammoType", "_randPosInArea", "_detonationHight"]; private _projectile = createVehicle [_ammotype, _randPosInArea, [], 0, "NONE"]; if (_ammoType isEqualTo QGVAR(artillery_ILLUM)) then { - _projectile setvelocity [0,0,-3]; + _projectile setVelocity [0,0,-3]; } else { - _projectile setvelocity [0,0,-150]; + _projectile setVelocity [0,0,-150]; - if !(_detonationHight isEqualTo 0) then { - [_projectile, _detonationHight] call FUNC(artyAirburst); + if (_detonationHight isNotEqualTo 0) then { + [_projectile, _detonationHight] remoteExecCall [QFUNC(artyAirburst), 2]; // exec on server }; }; }, [_ammoType, _randPosInArea, _detonationHight], _randDelay] call CBA_fnc_waitAndExecute;