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
This commit is contained in:
DESKTOP-UH65DCE\MusTanG 2017-07-04 10:25:23 -05:00
parent 1e77e0a22b
commit 657d4c7b29

View File

@ -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