Skip to content

Commit

Permalink
refactor(client): don't remove points on model change
Browse files Browse the repository at this point in the history
Co-authored-by: David Malchin <[email protected]>
  • Loading branch information
solareon and D4isDAVID committed Sep 24, 2024
1 parent ed49029 commit 12826ac
Showing 1 changed file with 5 additions and 17 deletions.
22 changes: 5 additions & 17 deletions client/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -675,24 +675,12 @@ RegisterNetEvent('qbx_vehicleshop:client:swapVehicle', function(data)

if not vehPoint then return end

if vehPoint.veh then
if DoesEntityExist(vehPoint.veh) then
DeleteEntity(vehPoint.veh)
end
if config.useTarget then
exports.ox_target:removeLocalEntity(vehPoint.veh, 'vehicleshop:showVehicleOptions')
else
vehPoint.boxZone:remove()
end
dataTargetVehicle.vehicle = data.toVehicle
vehPoint.model = data.toVehicle
if vehPoint.currentDistance <= vehPoint.distance then
vehPoint:onExit()
vehPoint:onEnter()
end
vehPoint:remove()

createShowroomVehiclePoint({
coords = dataTargetVehicle.coords,
shopName = shopName,
vehiclePos = data.targetVehicle,
model = data.toVehicle
})
end)

local function confirmTrade(confirmationText)
Expand Down

0 comments on commit 12826ac

Please sign in to comment.