From 657d4c7b29050019df08baf1b8cd194dfed3a61b Mon Sep 17 00:00:00 2001 From: "DESKTOP-UH65DCE\\MusTanG" Date: Tue, 4 Jul 2017 10:25:23 -0500 Subject: [PATCH] Check and Correct Old Vehicle DB array When hosts upgrade they will have vehicles saved in their DB with the old dataFormat. This check by @He-Man will do the trick to solve this issue moving forward with vehicle upgrades --- .../compile/epoch_vehicle/EPOCH_load_vehicles.sqf | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Sources/epoch_server/compile/epoch_vehicle/EPOCH_load_vehicles.sqf b/Sources/epoch_server/compile/epoch_vehicle/EPOCH_load_vehicles.sqf index 36eec12f..7ec842cd 100644 --- a/Sources/epoch_server/compile/epoch_vehicle/EPOCH_load_vehicles.sqf +++ b/Sources/epoch_server/compile/epoch_vehicle/EPOCH_load_vehicles.sqf @@ -42,7 +42,17 @@ for "_i" from 1 to _maxVehicleLimit do { if ((_response select 0) == 1 && (_response select 1) isEqualType []) then { _arr = _response select 1; _arrNum = count _arr; - + + // New Upgrade System adds to DB array, check and correct older saved vehicles + if (_arrNum < _dataFormatCount) then { + { + _check = _arr select _foreachindex; + if (isnil '_check') then { + _arr pushback (_dataFormat select _foreachindex); + }; + } foreach _dataFormat; + }; + if (_arrNum == _dataFormatCount) then { // Validate and replace invaild data