fix(client/vehicleProperties): Fix error on gameBuilds below 2372 (#417)

This commit is contained in:
Lunar-Scripts
2023-09-19 11:59:59 +02:00
committed by GitHub
parent 02d935237d
commit fe94c5be7a

View File

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