fix(vehicle): netId & properties inconsistencies

This commit is contained in:
Andyyy7666 committed 2023-09-26 23:00:51 +02:00
1 parent 276274cf74
commit 698707c992
2 files changed
+19 -12

No files matched your search

+4 -2
View File
@@ -87,8 +87,10 @@ function NDCore.getVehicle(entity)
function self.delete(saveProperties)
if not DoesEntityExist(entity) then return end
if saveProperties and self.id and self.owner then
local properties = lib.callback.await("ND_Vehicles:getProps", NetworkGetEntityOwner(entity))
MySQL.query("UPDATE nd_vehicles SET properties = ? WHERE id = ?", {json.encode(properties), self.id})
local properties = lib.callback.await("ND_Vehicles:getProps", NetworkGetEntityOwner(entity), self.netId)
if properties then
MySQL.query("UPDATE nd_vehicles SET properties = ? WHERE id = ?", {json.encode(properties), self.id})
end
end
DeleteEntity(entity)
end