From 6c5cf055597a8e57758ade30a11d8fe760859169 Mon Sep 17 00:00:00 2001 From: Manason Date: Tue, 22 Oct 2024 11:23:39 -0700 Subject: [PATCH] fix(server/vehicle-persistence): get session id while vehicle exists --- server/vehicle-persistence.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/vehicle-persistence.lua b/server/vehicle-persistence.lua index 260134e27..c16148b67 100644 --- a/server/vehicle-persistence.lua +++ b/server/vehicle-persistence.lua @@ -98,6 +98,7 @@ end AddEventHandler('entityRemoved', function(entity) if not Entity(entity).state.persisted then return end + local sessionId = Entity(entity).state.sessionId local coords = GetEntityCoords(entity) local heading = GetEntityHeading(entity) local bucket = GetEntityRoutingBucket(entity) @@ -106,7 +107,6 @@ AddEventHandler('entityRemoved', function(entity) local vehicleId = getVehicleId(entity) if not vehicleId then return end - local sessionId = Entity(entity).state.sessionId local playerVehicle = exports.qbx_vehicles:GetPlayerVehicle(vehicleId) if DoesEntityExist(entity) then