From f985d00b6115cf31a8beeb7cefdaa5e0fcf78b66 Mon Sep 17 00:00:00 2001 From: TenPlus1 Date: Tue, 11 Jul 2017 21:22:58 +0100 Subject: [PATCH] added forgotton mobs:explosion global function for backwards compatibility --- api.lua | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/api.lua b/api.lua index b61a703..8fa2149 100644 --- a/api.lua +++ b/api.lua @@ -2973,6 +2973,23 @@ function mobs:register_arrow(name, def) end +function mobs:explosion(pos, radius) + + if minetest.get_modpath("tnt") and tnt and tnt.boom then + + tnt.boom(pos, { + radius = radius, + damage_radius = radius, +-- sound = self.sounds.explode, + }) + else + mob_sound(self, self.sounds.explode) + entity_physics(pos, radius) + effect(pos, 32, "tnt_smoke.png", radius * 3, radius * 5, radius, 1, 0) + end +end + + -- Register spawn eggs -- Note: This also introduces the “spawn_egg” group: