fix(client/setVehicleProperties): force clear custom colours (#375)

This commit is contained in:
Lukas Brūzga
2023-07-23 06:14:44 +03:00
committed by GitHub
parent 588d26c421
commit f641881243

View File

@@ -304,6 +304,7 @@ function lib.setVehicleProperties(vehicle, props)
if props.color1 then if props.color1 then
if type(props.color1) == 'number' then if type(props.color1) == 'number' then
ClearVehicleCustomPrimaryColour(vehicle)
SetVehicleColours(vehicle, props.color1 --[[@as number]], colorSecondary --[[@as number]]) SetVehicleColours(vehicle, props.color1 --[[@as number]], colorSecondary --[[@as number]])
else else
SetVehicleCustomPrimaryColour(vehicle, props.color1[1], props.color1[2], props.color1[3]) SetVehicleCustomPrimaryColour(vehicle, props.color1[1], props.color1[2], props.color1[3])
@@ -312,6 +313,7 @@ function lib.setVehicleProperties(vehicle, props)
if props.color2 then if props.color2 then
if type(props.color2) == 'number' then if type(props.color2) == 'number' then
ClearVehicleCustomPrimaryColour(vehicle)
SetVehicleColours(vehicle, props.color1 or colorPrimary --[[@as number]], props.color2 --[[@as number]]) SetVehicleColours(vehicle, props.color1 or colorPrimary --[[@as number]], props.color2 --[[@as number]])
else else
SetVehicleCustomSecondaryColour(vehicle, props.color2[1], props.color2[2], props.color2[3]) SetVehicleCustomSecondaryColour(vehicle, props.color2[1], props.color2[2], props.color2[3])