From 74803e01a486f43f129c6f93383a087eacca1b22 Mon Sep 17 00:00:00 2001 From: FlorianGH <34156280+FlorianGH@users.noreply.github.com> Date: Wed, 29 Jul 2020 19:56:23 +0200 Subject: [PATCH 1/2] Update fn_clearVehicleAmmo.sqf --- .../core/functions/fn_clearVehicleAmmo.sqf | 35 +++++++++---------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/Altis_Life.Altis/core/functions/fn_clearVehicleAmmo.sqf b/Altis_Life.Altis/core/functions/fn_clearVehicleAmmo.sqf index 7a933afac..e3d173cdb 100644 --- a/Altis_Life.Altis/core/functions/fn_clearVehicleAmmo.sqf +++ b/Altis_Life.Altis/core/functions/fn_clearVehicleAmmo.sqf @@ -14,24 +14,23 @@ _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]]; +switch (_veh) 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]]; + }; }; clearWeaponCargoGlobal _vehicle; From 2b93c7eaf05aab4b670f1887f36be11162ce6189 Mon Sep 17 00:00:00 2001 From: FlorianGH <34156280+FlorianGH@users.noreply.github.com> Date: Wed, 29 Jul 2020 20:15:48 +0200 Subject: [PATCH 2/2] Update fn_clearVehicleAmmo.sqf Like this? --- .../core/functions/fn_clearVehicleAmmo.sqf | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Altis_Life.Altis/core/functions/fn_clearVehicleAmmo.sqf b/Altis_Life.Altis/core/functions/fn_clearVehicleAmmo.sqf index e3d173cdb..ef59f5a9a 100644 --- a/Altis_Life.Altis/core/functions/fn_clearVehicleAmmo.sqf +++ b/Altis_Life.Altis/core/functions/fn_clearVehicleAmmo.sqf @@ -12,9 +12,16 @@ private ["_vehicle","_veh"]; _vehicle = [_this,0,objNull,[objNull]] call BIS_fnc_param; if (isNull _vehicle) exitWith {}; -_veh = typeOf _vehicle; +private ["_vehicle","_veh"]; +_vehicle = [_this,0,objNull,[objNull]] call BIS_fnc_param; +if (isNull _vehicle) exitWith {}; -switch (_veh) do { +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]]; }; @@ -32,8 +39,3 @@ switch (_veh) do { _vehicle removeMagazinesTurret ["2000Rnd_65x39_Belt_Tracer_Red",[2]]; }; }; - -clearWeaponCargoGlobal _vehicle; -clearMagazineCargoGlobal _vehicle; -clearItemCargoGlobal _vehicle; -clearBackpackCargoGlobal _vehicle;