From fe94c5be7a65423745b4737114b9437201939ce3 Mon Sep 17 00:00:00 2001 From: Lunar-Scripts <119682264+Lunar-Scripts@users.noreply.github.com> Date: Tue, 19 Sep 2023 11:59:59 +0200 Subject: [PATCH] fix(client/vehicleProperties): Fix error on gameBuilds below 2372 (#417) --- resource/vehicleProperties/client.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/resource/vehicleProperties/client.lua b/resource/vehicleProperties/client.lua index 53fffd1..b333985 100644 --- a/resource/vehicleProperties/client.lua +++ b/resource/vehicleProperties/client.lua @@ -114,6 +114,8 @@ AddStateBagChangeHandler('setVehicleProperties', '', function(bagName, _, value) end) ]] +local gameBuild = GetGameBuildNumber() + ---@param vehicle number ---@return VehicleProperties? function lib.getVehicleProperties(vehicle) @@ -269,7 +271,7 @@ function lib.getVehicleProperties(vehicle) doors = damage.doors, tyres = damage.tyres, bulletProofTyres = GetVehicleTyresCanBurst(vehicle), - driftTyres = GetDriftTyresEnabled(vehicle), + driftTyres = gameBuild >= 2372 and GetDriftTyresEnabled(vehicle), -- no setters? -- leftHeadlight = GetIsLeftVehicleHeadlightDamaged(vehicle), -- rightHeadlight = GetIsRightVehicleHeadlightDamaged(vehicle), @@ -633,7 +635,7 @@ function lib.setVehicleProperties(vehicle, props, fixVehicle) SetVehicleTyresCanBurst(vehicle, props.bulletProofTyres) end - if props.driftTyres then + if gameBuild >= 2372 and props.driftTyres then SetDriftTyresEnabled(vehicle, true) end