possible fix for death handler issues

This commit is contained in:
LazyBoot 2022-12-17 00:58:30 +01:00
parent fe1d7c341c
commit bf0511af4d
No known key found for this signature in database
GPG Key ID: 0BD81D01FA2A433F

View File

@ -196,10 +196,15 @@ HOGGIT._deathHandler = function(event)
if event.id == world.event.S_EVENT_CRASH or event.id == world.event.S_EVENT_DEAD or event.id == world.event.S_EVENT_ENGINE_SHUTDOWN then
HOGGIT.debug_text("SOMETHING DEAD YO", 10)
if not event.initiator then return end
if not event.initiator.getGroup then return end
if not event.initiator:getGroup() then return end
if not event.initiator.getName then return end
if not event.initiator:getName() then return end
local grp = event.initiator:getGroup():getName()
local uName = event.initiator:getName()
local mGrp = mist.DBs.unitsByName[uName]
if not mGrp then return end
local grp = mimGrp.groupName
if grp then
HOGGIT.debug_text("FOUND GROUP", 10)
if HOGGIT.zombies[grp] then
@ -216,7 +221,7 @@ HOGGIT._deathHandler = function(event)
HOGGIT.debug_text("STARTING DEAD CHECK", 10)
local needs_respawn = false
local partial_respawn = false
if not HOGGIT.GroupIsAlive(grp) then
if mist.groupIsDead(grp) then
needs_respawn = true
HOGGIT.debug_text("THEY DEAD, RESPAWNIN", 10)
elseif spawner:GetPartialDeathThresholdPercent() then