Add debug logging to onClientResourceStop cleanup, bump to 1.1.5
Temporary tracing to diagnose why safe props still show after resource stop despite DeleteObject being called.
This commit is contained in:
parent
091e4864f1
commit
d21d04f606
@ -292,11 +292,15 @@ end)
|
|||||||
AddEventHandler('onClientResourceStop', function(resourceName)
|
AddEventHandler('onClientResourceStop', function(resourceName)
|
||||||
if resourceName ~= GetCurrentResourceName() then return end
|
if resourceName ~= GetCurrentResourceName() then return end
|
||||||
|
|
||||||
|
dbg('onClientResourceStop disparado, limpando', tostring(next(spawnedSafes) and 'safes existentes' or 'nenhum safe'))
|
||||||
|
|
||||||
for id, ent in pairs(spawnedSafes) do
|
for id, ent in pairs(spawnedSafes) do
|
||||||
|
dbg('safe', id, 'entity', ent, 'DoesEntityExist antes:', DoesEntityExist(ent))
|
||||||
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)
|
FreezeEntityPosition(ent, false)
|
||||||
DeleteObject(ent)
|
DeleteObject(ent)
|
||||||
|
dbg('safe', id, 'DoesEntityExist depois do DeleteObject:', DoesEntityExist(ent))
|
||||||
end
|
end
|
||||||
spawnedSafes[id] = nil
|
spawnedSafes[id] = nil
|
||||||
end
|
end
|
||||||
|
|||||||
@ -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.4'
|
version '1.1.5'
|
||||||
|
|
||||||
-- Dependências
|
-- Dependências
|
||||||
dependencies {
|
dependencies {
|
||||||
|
|||||||
@ -1,3 +1,3 @@
|
|||||||
{
|
{
|
||||||
"version": "1.1.4"
|
"version": "1.1.5"
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user