Added some suggestions

This commit is contained in:
johnb432 2024-08-10 14:57:12 +02:00
parent dc52f7a362
commit 6656aa624c
2 changed files with 6 additions and 4 deletions

View File

@ -25,9 +25,6 @@ if (_turretPath isEqualTo []) then {
_turretPath = [0];
};
// If this is called while CSW has ammo, unload mags in gunner's turret
if (someAmmo _vehicle) then {[_vehicle, _turretPath] call FUNC(unloadMagazines)};
private _loadableMagazines = [_vehicle, _gunner, true] call FUNC(reload_getLoadableMagazines);
if (_loadableMagazines isEqualTo []) exitWith {TRACE_1("could not find reloadable mag",_vehicle)};
@ -49,6 +46,9 @@ if (_clearForcedMag) then {
if (_magazineInfo isEqualTo []) exitWith {};
_magazineInfo params ["_carryMag", "_turretPath", "_loadInfo", "_magSource", "", "_ammo"];
// If this is called while CSW has ammo, unload mags in gunner's turret
if (someAmmo _vehicle) then {[_vehicle, _turretPath] call FUNC(unloadMagazines)};
// Remove the mag from the source
[_magSource, _carryMag, _ammo] call EFUNC(common,removeSpecificMagazine);

View File

@ -17,7 +17,9 @@
params [["_vehicleMag", "", [""]]];
GVAR(vehicleMagCache) getOrDefaultCall [_vehicleMag, {
if (_vehicleMag == "") exitWith {};
GVAR(vehicleMagCache) getOrDefaultCall [toLowerANSI _vehicleMag, {
private _groups = "getNumber (_x >> _vehicleMag) == 1 && {isClass (configFile >> 'CfgMagazines' >> configName _x)}" configClasses (configFile >> QGVAR(groups));
_carryMag = configName (_groups param [0, configNull]);
TRACE_2("setting cache",_vehicleMag,_carryMag);