summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTenPlus1 <kinsellaja@yahoo.com>2018-08-08 10:15:26 +0100
committerTenPlus1 <kinsellaja@yahoo.com>2018-08-08 10:15:26 +0100
commit477ad596703011af7eded7070e3bfb2c3bef7587 (patch)
tree022ebe5649da7289d772710ddebb9393c41ea925
parentda0238cb846beb7a79b64c7b3e4386df6b0ab5d2 (diff)
tidy code
-rw-r--r--api.lua14
1 files changed, 8 insertions, 6 deletions
diff --git a/api.lua b/api.lua
index 917bf66..4475ffa 100644
--- a/api.lua
+++ b/api.lua
@@ -3,7 +3,7 @@
mobs = {}
mobs.mod = "redo"
-mobs.version = "20180803"
+mobs.version = "20180808"
-- Intllib
@@ -182,7 +182,7 @@ local set_animation = function(self, anim)
self.animation.current = self.animation.current or ""
- -- only set different animation
+ -- only set different animation for attacks when setting to same set
if anim ~= "punch" and anim ~= "shoot"
and string.find(self.animation.current, anim) then
return
@@ -1171,7 +1171,7 @@ local smart_mobs = function(self, s, p, dist, dtime)
end, self)
end
- if math.abs(vector.subtract(s,target_pos).y) > self.stepheight then
+ if abs(vector.subtract(s,target_pos).y) > self.stepheight then
if height_switcher then
use_pathfind = true
@@ -3457,8 +3457,9 @@ end
-- compatibility function
function mobs:explosion(pos, radius)
- local self = {sounds = {}}
- self.sounds.explode = "tnt_explode"
+
+ local self = {sounds = {explode = "tnt_explode"}}
+
mobs:boom(self, pos, radius)
end
@@ -3473,6 +3474,7 @@ function mobs:safe_boom(self, pos, radius)
})
entity_physics(pos, radius)
+
effect(pos, 32, "tnt_smoke.png", radius * 3, radius * 5, radius, 1, 0)
end
@@ -3945,7 +3947,7 @@ function mobs:alias_mob(old_name, new_name)
physical = false,
- on_step = function(self)
+ on_activate = function(self)
if minetest.registered_entities[new_name] then
minetest.add_entity(self.object:get_pos(), new_name)