From a37e38da6071146947e3d1ecc087725846bbd1b4 Mon Sep 17 00:00:00 2001 From: TenPlus1 Date: Fri, 24 Mar 2017 10:13:25 +0000 Subject: [PATCH] Exploding mobs only drop items when killed, not when they explode --- api.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/api.lua b/api.lua index 847bd41..04b908d 100644 --- a/api.lua +++ b/api.lua @@ -1,5 +1,5 @@ --- Mobs Api (21st March 2017) +-- Mobs Api (24th March 2017) mobs = {} mobs.mod = "redo" @@ -1546,9 +1546,6 @@ local do_states = function(self, dtime) local pos = self.object:getpos() 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 if minetest.find_node_near(pos, 1, {"group:water"}) or minetest.is_protected(pos, "") then @@ -1559,6 +1556,9 @@ local do_states = function(self, dtime) effect(pos, 15, "tnt_smoke.png") + -- hurt player/mobs caught in blast area + entity_physics(pos, radius) + return end @@ -1568,6 +1568,8 @@ local do_states = function(self, dtime) self.object:remove() + entity_physics(pos, radius) + return end end