From 87586459bc4396a9458b0662a41ee753c507547d Mon Sep 17 00:00:00 2001 From: Salluci Date: Fri, 14 Jul 2023 00:12:18 +0300 Subject: [PATCH] fix stupid, add turretPath bool --- addons/csw/functions/fnc_unloadMagazines.sqf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/csw/functions/fnc_unloadMagazines.sqf b/addons/csw/functions/fnc_unloadMagazines.sqf index 7e1fbffb19..d74045c985 100644 --- a/addons/csw/functions/fnc_unloadMagazines.sqf +++ b/addons/csw/functions/fnc_unloadMagazines.sqf @@ -5,7 +5,7 @@ * * Arguments: * 0: CSW (default: objNull) - * 1: Turret Path (default: [0], gunner turret) + * 1: Turret Path or to unload all turrets (default: [0], gunner turret) * 2: Return removed magazines (default: true) * * Return Value: @@ -16,7 +16,7 @@ * * Public: Yes */ -params [["_vehicle", objNull, [objNull]], ["_turretPath", [0], [0]], ["_returnMags", true, [true]]]; +params [["_vehicle", objNull, [objNull]], ["_turretPath", [0], [[0], true]], ["_returnMags", true, [true]]]; if (isNull _vehicle) exitWith {}; @@ -26,7 +26,7 @@ private _containerMagazineCount = []; { _x params ["_xMag", "_xTurret", "_xAmmo"]; - if (_xTurret isNotEqualTo _turretPath) then {continue}; + if (_xTurret isNotEqualTo _turretPath && {_turretPath isNotEqualTo true}) then {continue}; private _carryMag = _xMag call FUNC(getCarryMagazine); if (_carryMag != "") then { _magsToRemove pushBackUnique [_xMag, _xTurret]; @@ -37,7 +37,7 @@ private _containerMagazineCount = []; }; _containerMagazineCount set [_index, (_containerMagazineCount select _index) + _xAmmo]; }; -} forEach (_vehicle magazinesAllTurrets _vehicle); +} forEach (magazinesAllTurrets _vehicle); { _vehicle removeMagazinesTurret _x;