From 8a860384247696dd145cf9fdc8672f07c4fbeab0 Mon Sep 17 00:00:00 2001 From: LeMagnesium Date: Fri, 20 Mar 2015 21:55:54 +0100 Subject: [PATCH] Fixed merge mistake leading to crash --- mods/mobs/api.lua | 2 +- mods/mobs/bunny.lua | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/mods/mobs/api.lua b/mods/mobs/api.lua index f44d928e..a0deeb77 100755 --- a/mods/mobs/api.lua +++ b/mods/mobs/api.lua @@ -819,7 +819,7 @@ function mobs:register_mob(name, def) get_staticdata = function(self) -- select random texture, set model if not self.base_texture then - self.base_texture = def.textures[math.random(1,#def.textures)] + self.base_texture = def.available_textures["texture_"..math.random(1,def.available_textures["total"])] self.base_mesh = def.mesh end -- set texture, model and size diff --git a/mods/mobs/bunny.lua b/mods/mobs/bunny.lua index 4aae98a9..be3c13b2 100755 --- a/mods/mobs/bunny.lua +++ b/mods/mobs/bunny.lua @@ -13,10 +13,11 @@ mobs:register_mob("mobs:bunny", { visual = "mesh", mesh = "mobs_bunny.b3d", drawtype = "front", - textures = { - {"mobs_bunny_grey.png"}, - {"mobs_bunny_brown.png"}, - {"mobs_bunny_white.png"}, + available_textures = { + total = 3, + texture_1 = {"mobs_bunny_grey.png"}, + texture_2 = {"mobs_bunny_brown.png"}, + texture_3 = {"mobs_bunny_white.png"}, }, -- sounds sounds = {},