mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Cookoff - Fix ammo not being removed from turrets with additional FFV (#8928)
This commit is contained in:
parent
3f7530d89e
commit
d8af7b34b7
@ -24,21 +24,18 @@ TRACE_1("getVehicleAmmo",_vehicle);
|
|||||||
private _ammoToDetonate = [];
|
private _ammoToDetonate = [];
|
||||||
private _totalAmmo = 0;
|
private _totalAmmo = 0;
|
||||||
|
|
||||||
// from ace_common, tweaked becasue command is busted
|
|
||||||
private _ffvTurrets = fullCrew [_vehicle, "", true] select {_x select 4} apply {_x select 3};
|
|
||||||
|
|
||||||
// Get ammo from turrets
|
// Get ammo from turrets
|
||||||
{
|
{
|
||||||
_x params ["_mag", "_turret", "_count"];
|
_x params ["_mag", "_turret", "_count"];
|
||||||
// if the turret is an FFV seat, it takes magazines from the soldier
|
// if the turret is an FFV seat, it takes magazines from the soldier
|
||||||
if (!(_turret in _ffvTurrets) && {_count > 0}) then {
|
if (_count > 0) then {
|
||||||
private _ammo = getText (configFile >> "CfgMagazines" >> _mag >> "ammo");
|
private _ammo = getText (configFile >> "CfgMagazines" >> _mag >> "ammo");
|
||||||
private _model = getText (configFile >> "CfgAmmo" >> _ammo >> "model");
|
private _model = getText (configFile >> "CfgAmmo" >> _ammo >> "model");
|
||||||
if (_model == "\A3\weapons_f\empty") exitWith {TRACE_3("skipping",_mag,_ammo,_model);};
|
if (_model == "\A3\weapons_f\empty") exitWith {TRACE_3("skipping",_mag,_ammo,_model);};
|
||||||
_ammoToDetonate pushBack [_mag, _count];
|
_ammoToDetonate pushBack [_mag, _count];
|
||||||
_totalAmmo = _totalAmmo + _count;
|
_totalAmmo = _totalAmmo + _count;
|
||||||
};
|
};
|
||||||
} forEach (magazinesAllTurrets _vehicle);
|
} forEach (magazinesAllTurrets [_vehicle, true]);
|
||||||
|
|
||||||
// Get ammo from cargo space
|
// Get ammo from cargo space
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user