Unfreeze safe props before deleting, bump to 1.1.4

Deleting a frozen object left a stale rendered mesh on screen until
the area re-streamed. Unfreezing right before DeleteObject clears it
immediately, matching how safe:despawn already looked to behave.
This commit is contained in:
Bxio 2026-08-03 11:52:59 +00:00
parent 55b4506225
commit 091e4864f1
3 changed files with 4 additions and 2 deletions

View File

@ -126,6 +126,7 @@ RegisterNetEvent('safe:despawn', function(id)
local ent = spawnedSafes[id]
if ent and DoesEntityExist(ent) then
pcall(function() ox_target:removeLocalEntity(ent) end)
FreezeEntityPosition(ent, false)
DeleteObject(ent)
end
spawnedSafes[id] = nil
@ -294,6 +295,7 @@ AddEventHandler('onClientResourceStop', function(resourceName)
for id, ent in pairs(spawnedSafes) do
if ent and DoesEntityExist(ent) then
pcall(function() ox_target:removeLocalEntity(ent) end)
FreezeEntityPosition(ent, false)
DeleteObject(ent)
end
spawnedSafes[id] = nil

View File

@ -4,7 +4,7 @@ lua54 'yes'
author 'SeuNome'
description 'Sistema de safes com ox_inventory e ox_target'
version '1.1.3'
version '1.1.4'
-- Dependências
dependencies {

View File

@ -1,3 +1,3 @@
{
"version": "1.1.3"
"version": "1.1.4"
}