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)
|
||||
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
|
||||
dbg('safe', id, 'entity', ent, 'DoesEntityExist antes:', DoesEntityExist(ent))
|
||||
if ent and DoesEntityExist(ent) then
|
||||
pcall(function() ox_target:removeLocalEntity(ent) end)
|
||||
FreezeEntityPosition(ent, false)
|
||||
DeleteObject(ent)
|
||||
dbg('safe', id, 'DoesEntityExist depois do DeleteObject:', DoesEntityExist(ent))
|
||||
end
|
||||
spawnedSafes[id] = nil
|
||||
end
|
||||
|
||||
@ -4,7 +4,7 @@ lua54 'yes'
|
||||
|
||||
author 'SeuNome'
|
||||
description 'Sistema de safes com ox_inventory e ox_target'
|
||||
version '1.1.4'
|
||||
version '1.1.5'
|
||||
|
||||
-- Dependências
|
||||
dependencies {
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
{
|
||||
"version": "1.1.4"
|
||||
"version": "1.1.5"
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user