Skip to content

Commit

Permalink
Weapon fixes (#682)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ollieollieolllie authored Jan 5, 2025
1 parent 1023bbb commit a418423
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@ private _CannonFired = (_heli getVariable "fza_ah64_burst_fired") + 1;

if (_burstLimit != -1) then {
if (_CannonFired >= _burstLimit) then {
_heli selectweapon "fza_cannon_limit";
[_heli] spawn {
params["_heli"];
waitUntil {inputAction "defaultAction" < 0.5};
waitUntil {
_heli selectWeaponTurret ["fza_cannon_limit", [0]];
inputAction "defaultAction" < 0.5
};
if (currentweapon _heli != "fza_cannon_limit") exitwith {};
_heli selectWeapon "fza_m230";
_heli selectWeaponTurret ["fza_m230", [0]];
};
};
_heli setVariable ["fza_ah64_burst_fired", _CannonFired];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class AnimationSources
{
displayName = "Swap IAFS for 1200rnd magazine";
author = "AH-64D Development Team";
onPhaseChanged = "_this remoteExec [""fza_fnc_weaponSwapM230Mag"",_this # 0];";
onPhaseChanged = "_this call fza_fnc_weaponSwapM230Mag";
source = "user";
initPhase = 0;
animPeriod = 0.001;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
params ["_heli", "_phase"];

if (!local _heli) exitwith {};

_heli removeMagazineTurret ["fza_m230_300", [0]];
_heli removeMagazineTurret ["fza_m230_1200", [0]];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ if (_targetComp == "IAFS") exitwith {
private _nearestObject = nearestObject [_player, "fza_ah64_IAFS"];
deleteVehicle _nearestObject;
_target animateSource ["magazine_set_1200", 0];
[_target, 0] remoteExec ["fza_fnc_weaponSwapM230Mag", _target];
[_target, 0] remoteExec ["fza_fnc_weaponSwapM230Mag", [gunner _target, driver _target]];
//Spawn 1200rnd Mag
private _object = "fza_ah64_1200Magazine" createVehicle [0,0,0];
[_player, _object] call ace_dragging_fnc_carryObject;
Expand Down Expand Up @@ -80,7 +80,7 @@ if (_targetComp == "MAG") exitwith {
private _nearestObject = nearestObject [_player, "fza_ah64_1200Magazine"];
deleteVehicle _nearestObject;
_target animateSource ["magazine_set_1200", 1];
[_target, 1] remoteExec ["fza_fnc_weaponSwapM230Mag", _target];
[_target, 1] remoteExec ["fza_fnc_weaponSwapM230Mag", [gunner _target, driver _target]];
//spawn IAFS
private _object = "fza_ah64_IAFS" createVehicle [0,0,0];
[_player, _object] call ace_dragging_fnc_carryObject;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@ private _rocketsalvo = _heli getVariable "fza_ah64_rocketsalvo";

if (_rocketsalvo != 1) then {
if (_salvofired >= _rocketsalvo) then {
_heli selectweapon "fza_hydra_limit";
[_heli,_weapon] spawn {
params["_heli","_weapon"];
waitUntil {inputAction "defaultAction" < 0.5};
waitUntil {
_heli selectWeaponTurret ["fza_hydra_limit", [0]];
inputAction "defaultAction" < 0.5
};
if (currentweapon _heli != "fza_hydra_limit") exitwith {};
_heli selectWeapon _weapon;
_heli selectWeaponTurret [_weapon, [0]];;
};
};
_heli setVariable ["fza_ah64_salvofired", _salvofired];
Expand Down

0 comments on commit a418423

Please sign in to comment.