summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTenPlus1 <kinsellaja@yahoo.com>2018-08-31 10:31:30 +0100
committerTenPlus1 <kinsellaja@yahoo.com>2018-08-31 10:31:30 +0100
commite64df178f8e3017373fad5261fe6384486f4e87a (patch)
tree3a992c2efcb45e3ce00c10d0f22a7ef314bd5891
parent42473cbc233f44dd73d28d5481b2c3862ac5e7bc (diff)
added some checks
-rw-r--r--api.lua13
1 files changed, 7 insertions, 6 deletions
diff --git a/api.lua b/api.lua
index b5c8375..0a61bda 100644
--- a/api.lua
+++ b/api.lua
@@ -3,7 +3,7 @@
mobs = {}
mobs.mod = "redo"
-mobs.version = "20180808"
+mobs.version = "20180831"
-- Intllib
@@ -1745,8 +1745,8 @@ local do_states = function(self, dtime)
set_animation(self, "stand")
-- npc's ordered to stand stay standing
- if self.type ~= "npc"
- or self.order ~= "stand" then
+-- if self.type ~= "npc"
+ if self.order ~= "stand" then
if self.walk_chance ~= 0
and self.facing_fence ~= true
@@ -2286,7 +2286,8 @@ local falling = function(self, pos)
end
-- in water then float up
- if minetest.registered_nodes[self.standing_in].groups.water then
+ if self.standing_in
+ and minetest.registered_nodes[self.standing_in].groups.water then
if self.floats == 1 then
@@ -2692,11 +2693,11 @@ local mob_activate = function(self, staticdata, def, dtime)
if not self.base_texture then
-- compatiblity with old simple mobs textures
- if type(def.textures[1]) == "string" then
+ if def.textures and type(def.textures[1]) == "string" then
def.textures = {def.textures}
end
- self.base_texture = def.textures[random(1, #def.textures)]
+ self.base_texture = def.textures and def.textures[random(1, #def.textures)]
self.base_mesh = def.mesh
self.base_size = self.visual_size
self.base_colbox = self.collisionbox