Fix fn_fillturrets for non weapon vehicles

Thx to iben
This commit is contained in:
A Man
2022-06-04 10:49:05 +02:00
parent deaf0f926b
commit 627f5c8afc
2 changed files with 25 additions and 15 deletions

View File

@@ -30,7 +30,7 @@ local _findRecurse = {
{
local _mag = _x;
if !(["horn",_mag] call fnc_inString) then {
if !(["Horn",_mag] call fnc_inString) then {
if (DZE_clearVehicleFlares) then {
_obj removeMagazinesTurret[_mag,_turret];
} else {

View File

@@ -27,21 +27,31 @@ local _findRecurse = {
{
local _type = _x select 0;
local _turret = _x select 1;
local _mags = getArray(configFile >> "CfgWeapons" >> _type >> "magazines");
local _mag = _mags select 0;
if (!isNil "_mag" && {!(["horn",_mag] call fnc_inString)})then {
for "_i" from 1 to _countMags do {
_obj addMagazineTurret[_mag,_turret];
};
};
if (!(["Horn",_type] call fnc_inString) && (_type != "")) then {
local _turret = _x select 1;
local _mags = getArray(configFile >> "CfgWeapons" >> _type >> "magazines");
local _mag = _mags select 0;
if (!isNil "_mag")then {
for "_i" from 1 to _countMags do {
_obj addMagazineTurret[_mag,_turret];
};
};
};
} forEach _weaponArray;
{
local _mags = getArray(configFile >> "CfgWeapons" >> _x >> "magazines");
local _mag = _mags select 0;
for "_i" from 1 to _countMags do {
_obj addMagazine _mag;
};
local _weapon = _x;
if !(["Horn",_weapon] call fnc_inString) then {
local _mags = getArray(configFile >> "CfgWeapons" >> _weapon >> "magazines");
local _mag = _mags select 0;
if (!isNil "_mag")then {
for "_i" from 1 to _countMags do {
_obj addMagazine _mag;
};
};
};
} count (weapons _obj);