mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Check for dead & minor cleanup
This commit is contained in:
parent
cf89aade69
commit
aae708ad00
@ -22,7 +22,7 @@
|
||||
|
||||
params [["_vehicle", objNull, [objNull]], ["_carryMag", "", [""]], ["_turretPath", [0], [[0]]], ["_instantReload", false, [false]], ["_clearForcedMag", true, [true]]];
|
||||
|
||||
if !(alive _vehicle && {!isNull (_vehicle turretUnit _turretPath)}) exitWith {false};
|
||||
if (!alive _vehicle || {!alive (_vehicle turretUnit _turretPath)}) exitWith {false};
|
||||
|
||||
// must be config case
|
||||
_carryMag = configName (configFile >> "CfgMagazines" >> _carryMag);
|
||||
|
@ -26,11 +26,6 @@ if (!alive _vehicle) exitWith {createHashMap};
|
||||
|
||||
private _availableMagazines = createHashMap;
|
||||
|
||||
private _fnc_addAmmo = {
|
||||
params ["_magazine", "_ammo"];
|
||||
_availableMagazines set [_magazine, (_availableMagazines getOrDefault [_magazine, 0]) + _ammo];
|
||||
};
|
||||
|
||||
{
|
||||
_x params ["_xMag", "", "_xAmmo"];
|
||||
|
||||
@ -39,7 +34,7 @@ private _fnc_addAmmo = {
|
||||
private _carryMag = _xMag call FUNC(getCarryMagazine);
|
||||
if (_carryMag isEqualTo "") then {continue};
|
||||
|
||||
[_carryMag, _xAmmo] call _fnc_addAmmo
|
||||
_availableMagazines set [_carryMag, (_availableMagazines getOrDefault [_carryMag, 0]) + _xAmmo];
|
||||
} forEach (magazinesAllTurrets _vehicle);
|
||||
|
||||
if (_onlyLoaded) exitWith {_availableMagazines};
|
||||
@ -51,7 +46,9 @@ if (_sources isEqualTo []) exitWith {_availableMagazines};
|
||||
{
|
||||
private _source = _x;
|
||||
{
|
||||
_x call _fnc_addAmmo
|
||||
_x params ["_xMag", "_xAmmo"];
|
||||
|
||||
_availableMagazines set [_xMag, (_availableMagazines getOrDefault [_xMag, 0]) + _xAmmo];
|
||||
} forEach ([_source, _vehicle] call FUNC(getSourceCompatibleMagazines));
|
||||
} forEach _sources;
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
params [["_source", objNull, [objNull]], ["_csw", objNull, [objNull]]];
|
||||
|
||||
if (isNull _source || {isNull _csw}) exitWith {[]};
|
||||
if (isNull _source || {!alive _csw}) exitWith {[]};
|
||||
|
||||
if !(typeOf _csw in GVAR(initializedStaticTypes)) exitWith {[]};
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
||||
params ["_vehicle"];
|
||||
if (!alive _vehicle) exitWith { WARNING_1("%1 not alive",_vehicle); };
|
||||
if (!simulationEnabled _vehicle) exitWith {
|
||||
[{simulationEnabled _this}, FUNC(initVehicle), _vehicle] call CBA_fnc_waitUntilAndExecute;
|
||||
[{simulationEnabled _this}, LINKFUNC(initVehicle), _vehicle] call CBA_fnc_waitUntilAndExecute;
|
||||
};
|
||||
|
||||
private _typeOf = typeOf _vehicle;
|
||||
|
Loading…
Reference in New Issue
Block a user