Update fnc_getNeedRearmMagazines.sqf (#8456)

This commit is contained in:
Drofseh 2021-10-12 14:08:06 -07:00 committed by GitHub
parent e4be783f80
commit 40ec4e9137
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -58,10 +58,19 @@ private _pylonConfigs = configProperties [configOf _vehicle >> "Components" >> "
private _turrets = [_vehicle] call FUNC(getAllRearmTurrets);
{
private _turretPath = _x;
private _magazines = [_vehicle, _turretPath] call FUNC(getTurretConfigMagazines);
private _magazineClasses = [];
// _magazines without duplicates
private _magazineClasses = _magazines arrayIntersect _magazines;
if (_vehicle getVariable [QGVAR(scriptedLoadout), false]) then {
{
_x params ["_className", "_turretCurrent"];
if (_turretPath isEqualTo _turretCurrent) then {
_magazineClasses pushBackUnique _className;
};
} forEach (magazinesAllTurrets _vehicle);
} else {
_magazineClasses = [_vehicle, _turretPath] call FUNC(getTurretConfigMagazines);
_magazineClasses = _magazineClasses arrayIntersect _magazineClasses;
};
{
private _magazineClass = _x;