diff options
| author | TenPlus1 <kinsellaja@yahoo.com> | 2018-08-08 10:15:26 +0100 | 
|---|---|---|
| committer | TenPlus1 <kinsellaja@yahoo.com> | 2018-08-08 10:15:26 +0100 | 
| commit | 477ad596703011af7eded7070e3bfb2c3bef7587 (patch) | |
| tree | 022ebe5649da7289d772710ddebb9393c41ea925 | |
| parent | da0238cb846beb7a79b64c7b3e4386df6b0ab5d2 (diff) | |
tidy code
| -rw-r--r-- | api.lua | 14 | 
1 files changed, 8 insertions, 6 deletions
@@ -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)  | 
