From 04256665b5bcd06bb0ac4672d9fce0cf7c8fcece Mon Sep 17 00:00:00 2001 From: TenPlus1 Date: Sun, 4 Oct 2015 17:49:14 +0100 Subject: [PATCH] Added return after remove --- api.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api.lua b/api.lua index 041b229..9dd0623 100644 --- a/api.lua +++ b/api.lua @@ -1003,6 +1003,7 @@ end if self.type == "monster" and peaceful_only then self.object:remove() + return end -- load entity variables @@ -1353,7 +1354,6 @@ function check_for_death(self) return false end local pos = self.object:getpos() - self.object:remove() local obj = nil for _,drop in ipairs(self.drops) do if math.random(1, drop.chance) == 1 then @@ -1377,6 +1377,7 @@ function check_for_death(self) if self.on_die then self.on_die(self, pos) end + self.object:remove() return true end