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:
parent
55b4506225
commit
091e4864f1
@ -126,6 +126,7 @@ RegisterNetEvent('safe:despawn', function(id)
|
|||||||
local ent = spawnedSafes[id]
|
local ent = spawnedSafes[id]
|
||||||
if ent and DoesEntityExist(ent) then
|
if ent and DoesEntityExist(ent) then
|
||||||
pcall(function() ox_target:removeLocalEntity(ent) end)
|
pcall(function() ox_target:removeLocalEntity(ent) end)
|
||||||
|
FreezeEntityPosition(ent, false)
|
||||||
DeleteObject(ent)
|
DeleteObject(ent)
|
||||||
end
|
end
|
||||||
spawnedSafes[id] = nil
|
spawnedSafes[id] = nil
|
||||||
@ -294,6 +295,7 @@ AddEventHandler('onClientResourceStop', function(resourceName)
|
|||||||
for id, ent in pairs(spawnedSafes) do
|
for id, ent in pairs(spawnedSafes) do
|
||||||
if ent and DoesEntityExist(ent) then
|
if ent and DoesEntityExist(ent) then
|
||||||
pcall(function() ox_target:removeLocalEntity(ent) end)
|
pcall(function() ox_target:removeLocalEntity(ent) end)
|
||||||
|
FreezeEntityPosition(ent, false)
|
||||||
DeleteObject(ent)
|
DeleteObject(ent)
|
||||||
end
|
end
|
||||||
spawnedSafes[id] = nil
|
spawnedSafes[id] = nil
|
||||||
|
|||||||
@ -4,7 +4,7 @@ lua54 'yes'
|
|||||||
|
|
||||||
author 'SeuNome'
|
author 'SeuNome'
|
||||||
description 'Sistema de safes com ox_inventory e ox_target'
|
description 'Sistema de safes com ox_inventory e ox_target'
|
||||||
version '1.1.3'
|
version '1.1.4'
|
||||||
|
|
||||||
-- Dependências
|
-- Dependências
|
||||||
dependencies {
|
dependencies {
|
||||||
|
|||||||
@ -1,3 +1,3 @@
|
|||||||
{
|
{
|
||||||
"version": "1.1.3"
|
"version": "1.1.4"
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user