Skip to content

Commit

Permalink
fix(bridge/qb/client/functions): setting windows, tires, and door pro…
Browse files Browse the repository at this point in the history
…perties
  • Loading branch information
Manason authored Nov 15, 2023
1 parent 1d4daa1 commit ebb5af4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bridge/qb/client/functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -218,14 +218,16 @@ function functions.SetVehicleProperties(vehicle, props)
SetVehicleHeadlightsColour(vehicle, props.headlightColor)
end

if not props.tyres then
if (props.tireBurstCompletely or props.tireBurstState) and not props.tyres then
props.tyres = {}
for i = 0, 7 do
props.tyres[i] = props.tireBurstCompletely and props.tireBurstCompletely[i] and 2 or props.tireBurstState and props.tireBurstState[i] and 1 or nil
end
end

local numWindowsDamaged = 0
if props.windowStatus and not props.windows then
props.windows = {}
for i, isDamaged in pairs(props.windowStatus) do
if isDamaged then
numWindowsDamaged += 1
Expand All @@ -236,6 +238,7 @@ function functions.SetVehicleProperties(vehicle, props)

local numDoorsDamaged = 0
if props.doorStatus and not props.doors then
props.doors = {}
for i, isDamaged in pairs(props.doorStatus) do
if isDamaged then
numDoorsDamaged += 1
Expand Down

0 comments on commit ebb5af4

Please sign in to comment.