Fixes zombies.

- The respawn of zombies adds their new group to the zombie check.
This commit is contained in:
Lugghawk 2019-01-20 21:02:11 -05:00
parent da54b03054
commit 45523ae5bd

View File

@ -197,7 +197,7 @@ HOGGIT._deathHandler = function(event)
HOGGIT.debug_text("SOMETHING DEAD YO", 10) HOGGIT.debug_text("SOMETHING DEAD YO", 10)
if not event.initiator then return end if not event.initiator then return end
if not event.initiator.getGroup then return end if not event.initiator.getGroup then return end
local grp = event.initiator:getGroup():getName() local grp = event.initiator:getGroup():getName()
if grp then if grp then
HOGGIT.debug_text("FOUND GROUP", 10) HOGGIT.debug_text("FOUND GROUP", 10)
@ -239,17 +239,14 @@ HOGGIT._deathHandler = function(event)
HOGGIT.zombies[grp] = nil HOGGIT.zombies[grp] = nil
mist.scheduleFunction(function() mist.scheduleFunction(function()
spawner.Spawn() HOGGIT.setZombie(spawner.Spawn(), spawner, true)
end, {}, timer.getTime() + delay) end, {}, timer.getTime() + delay)
end end
HOGGIT.zombie_checks[spawner] = nil HOGGIT.zombie_checks[spawner] = nil
end, {}, timer.getTime() + 10) end, {}, timer.getTime() + 10)
HOGGIT.debug_text("Scheduled NEW dead check id ".. new_func_id .." for group: " .. grp, 10) HOGGIT.debug_text("Scheduled NEW dead check id ".. new_func_id .." for group: " .. grp, 10)
HOGGIT.zombie_checks[spawner] = new_func_id HOGGIT.zombie_checks[spawner] = new_func_id
else
end end
end end
end end