mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-13 19:52:38 +03:00
Update fn_fillTurrets to prevent out of index error
This commit is contained in:
@@ -31,9 +31,10 @@ local _findRecurse = {
|
|||||||
if (!(["Horn",_type] call fnc_inString) && (_type != "")) then {
|
if (!(["Horn",_type] call fnc_inString) && (_type != "")) then {
|
||||||
local _turret = _x select 1;
|
local _turret = _x select 1;
|
||||||
local _mags = getArray(configFile >> "CfgWeapons" >> _type >> "magazines");
|
local _mags = getArray(configFile >> "CfgWeapons" >> _type >> "magazines");
|
||||||
local _mag = _mags select 0;
|
|
||||||
|
|
||||||
if (!isNil "_mag")then {
|
if (count _mags > 0) then {
|
||||||
|
local _mag = _mags select 0;
|
||||||
|
|
||||||
for "_i" from 1 to _countMags do {
|
for "_i" from 1 to _countMags do {
|
||||||
_obj addMagazineTurret[_mag,_turret];
|
_obj addMagazineTurret[_mag,_turret];
|
||||||
};
|
};
|
||||||
@@ -46,9 +47,10 @@ local _findRecurse = {
|
|||||||
|
|
||||||
if !(["Horn",_weapon] call fnc_inString) then {
|
if !(["Horn",_weapon] call fnc_inString) then {
|
||||||
local _mags = getArray(configFile >> "CfgWeapons" >> _weapon >> "magazines");
|
local _mags = getArray(configFile >> "CfgWeapons" >> _weapon >> "magazines");
|
||||||
local _mag = _mags select 0;
|
|
||||||
|
|
||||||
if (!isNil "_mag")then {
|
if (count _mags > 0) then {
|
||||||
|
local _mag = _mags select 0;
|
||||||
|
|
||||||
for "_i" from 1 to _countMags do {
|
for "_i" from 1 to _countMags do {
|
||||||
_obj addMagazine _mag;
|
_obj addMagazine _mag;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user