Exploding mobs only drop items when killed, not when they explode

This commit is contained in:
TenPlus1 2017-03-24 10:13:25 +00:00
parent 374e7ac13b
commit a37e38da60

10
api.lua
View File

@ -1,5 +1,5 @@
-- Mobs Api (21st March 2017) -- Mobs Api (24th March 2017)
mobs = {} mobs = {}
mobs.mod = "redo" mobs.mod = "redo"
@ -1546,9 +1546,6 @@ local do_states = function(self, dtime)
local pos = self.object:getpos() local pos = self.object:getpos()
local radius = self.explosion_radius or 1 local radius = self.explosion_radius or 1
-- hurt player/mobs caught in blast area
entity_physics(pos, radius)
-- dont damage anything if area protected or next to water -- dont damage anything if area protected or next to water
if minetest.find_node_near(pos, 1, {"group:water"}) if minetest.find_node_near(pos, 1, {"group:water"})
or minetest.is_protected(pos, "") then or minetest.is_protected(pos, "") then
@ -1559,6 +1556,9 @@ local do_states = function(self, dtime)
effect(pos, 15, "tnt_smoke.png") effect(pos, 15, "tnt_smoke.png")
-- hurt player/mobs caught in blast area
entity_physics(pos, radius)
return return
end end
@ -1568,6 +1568,8 @@ local do_states = function(self, dtime)
self.object:remove() self.object:remove()
entity_physics(pos, radius)
return return
end end
end end