Added return after remove

This commit is contained in:
TenPlus1 2015-10-04 17:49:14 +01:00
parent 6568817c3d
commit 04256665b5

View File

@ -1003,6 +1003,7 @@ end
if self.type == "monster" if self.type == "monster"
and peaceful_only then and peaceful_only then
self.object:remove() self.object:remove()
return
end end
-- load entity variables -- load entity variables
@ -1353,7 +1354,6 @@ function check_for_death(self)
return false return false
end end
local pos = self.object:getpos() local pos = self.object:getpos()
self.object:remove()
local obj = nil local obj = nil
for _,drop in ipairs(self.drops) do for _,drop in ipairs(self.drops) do
if math.random(1, drop.chance) == 1 then if math.random(1, drop.chance) == 1 then
@ -1377,6 +1377,7 @@ function check_for_death(self)
if self.on_die then if self.on_die then
self.on_die(self, pos) self.on_die(self, pos)
end end
self.object:remove()
return true return true
end end