From 3e30124d667db72b8dbb696a469567fc8b877331 Mon Sep 17 00:00:00 2001 From: lopezloo <7338099+lopezloo@users.noreply.github.com> Date: Fri, 10 Feb 2023 14:00:43 +0100 Subject: [PATCH] Add color validation #2 --- loaddata.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/loaddata.js b/loaddata.js index 9c8bc82..6dce8d5 100644 --- a/loaddata.js +++ b/loaddata.js @@ -14,7 +14,15 @@ SetCarColors(cols) ]; if(cols !== undefined) for(let i = 0; i < cols.length; i++){ - let col = VehicleColours[cols[i]]; + // GTA color ID + let colorID = cols[i]; + + // RGB color + let col = VehicleColours[colorID]; + if(!col) { + continue; + } + carColors[i][0] = col[0]; carColors[i][1] = col[1]; carColors[i][2] = col[2];