From 4b88db027999a0ec459c017af3eb4a01b767eece Mon Sep 17 00:00:00 2001 From: He-Man Date: Wed, 14 Dec 2016 21:51:35 +0100 Subject: [PATCH] Safe/Load all Vehicle Magazines correctly --- .../epoch_vehicle/EPOCH_load_vehicles_old.sqf | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/Sources/epoch_server/compile/epoch_vehicle/EPOCH_load_vehicles_old.sqf b/Sources/epoch_server/compile/epoch_vehicle/EPOCH_load_vehicles_old.sqf index 04f0f00b..ad3afd50 100644 --- a/Sources/epoch_server/compile/epoch_vehicle/EPOCH_load_vehicles_old.sqf +++ b/Sources/epoch_server/compile/epoch_vehicle/EPOCH_load_vehicles_old.sqf @@ -225,9 +225,23 @@ for "_i" from 1 to _maxVehicleLimit do { } forEach _objTypes; } forEach (_arr select 5); - // remove and add back magazines works for armed trucks but not helis ATM - {_vehicle removeMagazineGlobal _x}count (magazines _vehicle); - {_vehicle addMagazine _x}count (_arr select 6); + // remove and add back magazines + if !((_arr select 6) isequalto []) then { + if ((_arr select 6 select 0) isequaltype true) then { + { + _vehicle removeMagazinesTurret [_x select 0, _x select 1]; + } foreach magazinesAllTurrets _vehicle; + { + if ((_x select 2) > 0) then { + _vehicle addMagazineTurret [_x select 0,_x select 1,_x select 2]; + }; + } foreach (_arr select 6 select 1); + } + else { + {_vehicle removeMagazineGlobal _x}count (magazines _vehicle); + {_vehicle addMagazine _x}count (_arr select 6); + }; + }; // turrets /*