CSW - Check carry mag exists (#7587)

Fix #7579
This commit is contained in:
PabstMirror 2020-03-11 18:42:21 -05:00 committed by GitHub
parent e89c172d34
commit 82116bd98b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 5 additions and 5 deletions

View File

@ -54,7 +54,7 @@ private _logAll = false;
private _weapMags = getArray (configFile >> "CfgWeapons" >> _x >> "magazines"); private _weapMags = getArray (configFile >> "CfgWeapons" >> _x >> "magazines");
{ {
private _xMag = _x; private _xMag = _x;
private _groups = "getNumber (_x >> _xMag) == 1" configClasses (configFile >> QGVAR(groups)); private _groups = "getNumber (_x >> _xMag) == 1 && {isClass (configFile >> 'CfgMagazines' >> configName _x)}" configClasses (configFile >> QGVAR(groups));
private _carryMag = configName (_groups param [0, configNull]); private _carryMag = configName (_groups param [0, configNull]);
if ((_carryMag == "") && {_logAll || {_xMag in _loadedMags}}) then { if ((_carryMag == "") && {_logAll || {_xMag in _loadedMags}}) then {
private _vehs = [_hash, _xMag] call CBA_fnc_hashGet; private _vehs = [_hash, _xMag] call CBA_fnc_hashGet;

View File

@ -33,7 +33,7 @@ private _allCarryMags = [];
private _xMag = _x; private _xMag = _x;
private _carryMag = GVAR(vehicleMagCache) getVariable _xMag; private _carryMag = GVAR(vehicleMagCache) getVariable _xMag;
if (isNil "_carryMag") then { if (isNil "_carryMag") then {
private _groups = "getNumber (_x >> _xMag) == 1" configClasses (configFile >> QGVAR(groups)); private _groups = "getNumber (_x >> _xMag) == 1 && {isClass (configFile >> 'CfgMagazines' >> configName _x)}" configClasses (configFile >> QGVAR(groups));
_carryMag = configName (_groups param [0, configNull]); _carryMag = configName (_groups param [0, configNull]);
GVAR(vehicleMagCache) setVariable [_x, _carryMag]; GVAR(vehicleMagCache) setVariable [_x, _carryMag];
TRACE_2("setting cache",_xMag,_carryMag); TRACE_2("setting cache",_xMag,_carryMag);

View File

@ -43,7 +43,7 @@
private _carryMag = GVAR(vehicleMagCache) getVariable _xMag; private _carryMag = GVAR(vehicleMagCache) getVariable _xMag;
if (isNil "_carryMag") then { if (isNil "_carryMag") then {
private _groups = "getNumber (_x >> _xMag) == 1" configClasses (configFile >> QGVAR(groups)); private _groups = "getNumber (_x >> _xMag) == 1 && {isClass (configFile >> 'CfgMagazines' >> configName _x)}" configClasses (configFile >> QGVAR(groups));
_carryMag = configName (_groups param [0, configNull]); _carryMag = configName (_groups param [0, configNull]);
GVAR(vehicleMagCache) setVariable [_xMag, _carryMag]; GVAR(vehicleMagCache) setVariable [_xMag, _carryMag];
TRACE_2("setting cache",_xMag,_carryMag); TRACE_2("setting cache",_xMag,_carryMag);

View File

@ -61,7 +61,7 @@ private _handeledMagTypes = [];
private _carryMag = GVAR(vehicleMagCache) getVariable _xMag; private _carryMag = GVAR(vehicleMagCache) getVariable _xMag;
if (isNil "_carryMag") then { if (isNil "_carryMag") then {
private _groups = "getNumber (_x >> _xMag) == 1" configClasses (configFile >> QGVAR(groups)); private _groups = "getNumber (_x >> _xMag) == 1 && {isClass (configFile >> 'CfgMagazines' >> configName _x)}" configClasses (configFile >> QGVAR(groups));
_carryMag = configName (_groups param [0, configNull]); _carryMag = configName (_groups param [0, configNull]);
GVAR(vehicleMagCache) setVariable [_xMag, _carryMag]; GVAR(vehicleMagCache) setVariable [_xMag, _carryMag];
TRACE_2("setting cache",_xMag,_carryMag); TRACE_2("setting cache",_xMag,_carryMag);

View File

@ -38,7 +38,7 @@ private _containerMagazineCount = [];
private _carryMag = GVAR(vehicleMagCache) getVariable _xMag; private _carryMag = GVAR(vehicleMagCache) getVariable _xMag;
if (isNil "_carryMag") then { if (isNil "_carryMag") then {
private _groups = "getNumber (_x >> _xMag) == 1" configClasses (configFile >> QGVAR(groups)); private _groups = "getNumber (_x >> _xMag) == 1 && {isClass (configFile >> 'CfgMagazines' >> configName _x)}" configClasses (configFile >> QGVAR(groups));
_carryMag = configName (_groups param [0, configNull]); _carryMag = configName (_groups param [0, configNull]);
GVAR(vehicleMagCache) setVariable [_xMag, _carryMag]; GVAR(vehicleMagCache) setVariable [_xMag, _carryMag];
TRACE_2("setting cache",_xMag,_carryMag); TRACE_2("setting cache",_xMag,_carryMag);