Actions cleanup

This commit is contained in:
ebaydayz
2016-03-29 14:47:28 -04:00
parent e1a0bfebc1
commit 71b975b05e
38 changed files with 330 additions and 503 deletions

View File

@@ -1,4 +1,5 @@
private ["_ammoType","_vehicle","_ammo","_weapon","_turret","_text","_array","_magazines"];
private ["_array","_vehicle","_weapon","_turret","_ammo","_text","_magazines","_ammoType"];
_array = _this select 3;
_vehicle = _array select 0;
_weapon = _array select 1;
@@ -11,9 +12,10 @@ _magazines = getArray (configFile >> "cfgWeapons" >> _weapon >> "magazines");
{
_ammoType = getText (configFile >> "cfgMagazines" >> _x >> "displayName");
if (_ammoType == "") then {_ammoType = _x;};
if (!(_ammoType in _text)) then {_text set [count _text,_ammoType];};
if !(_ammoType in _text) then {_text set [count _text,_ammoType];};
if (_x in magazines player) exitWith {_ammo = _x;};
} count _magazines;
if (_ammo != "") then {
_vehicle removeMagazineTurret [_ammo,_turret];
_vehicle addMagazineTurret [_ammo,_turret];