mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-28 17:01:14 +00:00
fix(es_extended/server/classes/vehicle): update self.plate in setPlate
setPlate re-keys Core.vehicles but never updates self.plate, so the object it was called on keeps pointing at the removed key. isValid() fails from then on and every later call on that handle is a no-op, including delete(), which leaves the vehicle spawned and owned_vehicles.stored at false.
This commit is contained in:
@@ -154,6 +154,7 @@ Core.vehicleClass = {
|
||||
vehicleData.plate = newPlate
|
||||
Core.vehicles[newPlate] = table.clone(vehicleData)
|
||||
Core.vehicles[oldPlate] = nil
|
||||
self.plate = newPlate
|
||||
|
||||
TriggerEvent("esx:changedExtendedVehiclePlate", vehicleData.plate, oldPlate)
|
||||
Wait(0)
|
||||
|
||||
Reference in New Issue
Block a user