summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTenPlus1 <kinsellaja@yahoo.com>2017-07-11 21:22:58 +0100
committerTenPlus1 <kinsellaja@yahoo.com>2017-07-11 21:22:58 +0100
commitf985d00b6115cf31a8beeb7cefdaa5e0fcf78b66 (patch)
tree35eadd7447db57d49f78b3c91512d55db8ed0f93
parent8dbea868ec2a0a1a3b67ea753844239692762bb7 (diff)
added forgotton mobs:explosion global function for backwards compatibility
-rw-r--r--api.lua17
1 files changed, 17 insertions, 0 deletions
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: