Add secondary existence check after main logic has been executed to prevent future crashes

This commit is contained in:
jordan4ibanez 2021-04-25 16:11:45 -04:00
parent d5a0fa1c14
commit 7e3b69348e
1 changed files with 6 additions and 0 deletions

View File

@ -1101,6 +1101,12 @@ mobs.mob_step = function(self, dtime)
end
end
--do not continue if non-existent
if not self or not self.object or not self.object:get_luaentity() then
self.object:remove()
return false
end
-- can mob be pushed, if so calculate direction -- do this last (overrides everything)
if self.pushable then