Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix projectile shrapnels for airburst arty #68

Merged
merged 1 commit into from
Oct 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions addons/zeus/functions/fnc_artyAirburst.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
8 changes: 4 additions & 4 deletions addons/zeus/functions/fnc_execArtyStrike.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down