From 85bd085ab8ddfe4541799b493f57079727d49309 Mon Sep 17 00:00:00 2001 From: Ombridride Date: Tue, 9 Dec 2014 13:56:43 +0100 Subject: [PATCH] Add multiple textures for mobs --- mods/mobs/api.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mods/mobs/api.lua b/mods/mobs/api.lua index fe21ef5e..61c90485 100644 --- a/mods/mobs/api.lua +++ b/mods/mobs/api.lua @@ -10,7 +10,7 @@ function mobs:register_mob(name, def) visual = def.visual, visual_size = def.visual_size, mesh = def.mesh, - textures = def.textures, + --textures = def.textures, makes_footstep_sound = def.makes_footstep_sound, view_range = def.view_range, walk_velocity = def.walk_velocity, @@ -636,8 +636,10 @@ function mobs:register_mob(name, def) local tmp = { lifetimer = self.lifetimer, tamed = self.tamed, - textures = { textures = self.textures }, + --textures = { textures = self.textures }, + textures = def.available_textures["texture_"..math.random(1,def.available_textures["total"])], } + self.object:set_properties(tmp) return minetest.serialize(tmp) end,