Skip to content

Commit

Permalink
fix(vehicle-persistence): use diff provided tyres changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Manason authored Nov 28, 2024
1 parent 0bd7528 commit 58d862e
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions server/vehicle-persistence.lua
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,7 @@ RegisterNetEvent('qbx_core:server:vehiclePropsChanged', function(netId, diff)
end

if diff.tyres then
local damage = {}
for i = 0, 7 do
if IsVehicleTyreBurst(vehicle, i, false) then
damage[i] = IsVehicleTyreBurst(vehicle, i, true) and 2 or 1
end
end

props.tyres = damage
props.tyres = diff.tyres ~= 'deleted' and diff.tyres or nil
end

exports.qbx_vehicles:SaveVehicle(vehicle, {
Expand Down

0 comments on commit 58d862e

Please sign in to comment.