diff --git a/Altis_Life.Altis/core/functions/fn_clearVehicleAmmo.sqf b/Altis_Life.Altis/core/functions/fn_clearVehicleAmmo.sqf index 7a933afac..ef59f5a9a 100644 --- a/Altis_Life.Altis/core/functions/fn_clearVehicleAmmo.sqf +++ b/Altis_Life.Altis/core/functions/fn_clearVehicleAmmo.sqf @@ -12,29 +12,30 @@ private ["_vehicle","_veh"]; _vehicle = [_this,0,objNull,[objNull]] call BIS_fnc_param; if (isNull _vehicle) exitWith {}; -_veh = typeOf _vehicle; - -if (_veh isEqualTo "B_Boat_Armed_01_minigun_F") then { - _vehicle removeMagazinesTurret ["200Rnd_40mm_G_belt",[0]]; -}; - -if (_veh isEqualTo "B_APC_Wheeled_01_cannon_F") then { - _vehicle removeMagazinesTurret ["60Rnd_40mm_GPR_Tracer_Red_shells",[0]]; - _vehicle removeMagazinesTurret ["40Rnd_40mm_APFSDS_Tracer_Red_shells",[0]]; -}; - -if (_veh isEqualTo "O_Heli_Attack_02_black_F") then { - _vehicle removeMagazinesTurret ["250Rnd_30mm_APDS_shells",[0]]; - _vehicle removeMagazinesTurret ["8Rnd_LG_scalpel",[0]]; - _vehicle removeMagazinesTurret ["38Rnd_80mm_rockets",[0]]; -}; - -if (_veh isEqualTo "B_Heli_Transport_01_F") then { - _vehicle removeMagazinesTurret ["2000Rnd_65x39_Belt_Tracer_Red",[1]]; - _vehicle removeMagazinesTurret ["2000Rnd_65x39_Belt_Tracer_Red",[2]]; -}; +private ["_vehicle","_veh"]; +_vehicle = [_this,0,objNull,[objNull]] call BIS_fnc_param; +if (isNull _vehicle) exitWith {}; clearWeaponCargoGlobal _vehicle; clearMagazineCargoGlobal _vehicle; clearItemCargoGlobal _vehicle; clearBackpackCargoGlobal _vehicle; + +switch (typeOf _vehicle) do { + case "B_Boat_Armed_01_minigun_F": { + _vehicle removeMagazinesTurret ["200Rnd_40mm_G_belt",[0]]; + }; + case "B_APC_Wheeled_01_cannon_F": { + _vehicle removeMagazinesTurret ["60Rnd_40mm_GPR_Tracer_Red_shells",[0]]; + _vehicle removeMagazinesTurret ["40Rnd_40mm_APFSDS_Tracer_Red_shells",[0]]; + }; + case "O_Heli_Attack_02_black_F": { + _vehicle removeMagazinesTurret ["250Rnd_30mm_APDS_shells",[0]]; + _vehicle removeMagazinesTurret ["8Rnd_LG_scalpel",[0]]; + _vehicle removeMagazinesTurret ["38Rnd_80mm_rockets",[0]]; + }; + case "B_Heli_Transport_01_F": { + _vehicle removeMagazinesTurret ["2000Rnd_65x39_Belt_Tracer_Red",[1]]; + _vehicle removeMagazinesTurret ["2000Rnd_65x39_Belt_Tracer_Red",[2]]; + }; +};