diff --git a/mods/ENTITIES/mcl_mobs/api.lua b/mods/ENTITIES/mcl_mobs/api.lua index b3dd76e17..ea93915a5 100644 --- a/mods/ENTITIES/mcl_mobs/api.lua +++ b/mods/ENTITIES/mcl_mobs/api.lua @@ -3467,7 +3467,10 @@ local mob_activate = function(self, staticdata, def, dtime) def.textures = {def.textures} end - self.base_texture = def.textures[random(1, #def.textures)] + local c = 1 + if #def.textures > c then c = #def.textures end + + self.base_texture = def.textures[math.random(c)] self.base_mesh = def.mesh self.base_size = self.visual_size self.base_colbox = self.collisionbox diff --git a/mods/ENTITIES/mobs_mc/tropical_fish.lua b/mods/ENTITIES/mobs_mc/tropical_fish.lua index d963665b2..fb321de96 100644 --- a/mods/ENTITIES/mobs_mc/tropical_fish.lua +++ b/mods/ENTITIES/mobs_mc/tropical_fish.lua @@ -72,7 +72,7 @@ local tropical_fish = { collisionbox = {-0.2, 0.0, -0.2, 0.2, 0.1, 0.2}, visual = "mesh", mesh = "extra_mobs_tropical_fish_a.b3d", - textures = {}, -- to be populated on_spawn + textures = { "extra_mobs_tropical_fish_a.png" }, -- to be populated on_spawn sounds = {}, animation = { stand_start = 0,