Changed the way that the cat.on_spawn picks a texture from the list.

This commit is contained in:
Michieal 2022-12-15 01:50:56 -05:00
parent 38e49a4b80
commit 20618a5a74
1 changed files with 2 additions and 1 deletions

View File

@ -162,7 +162,8 @@ cat.on_spawn = function(self)
self._texture = {"mobs_mc_cat_black.png"}
end
if not self._texture then
self._texture = cat.textures[math.random(#cat.textures)]
local max_tex = table.maxn (cat.textures)
self._texture = cat.textures[pr.next(1,max_tex)] -- pick a random texture.
end
self.object:set_properties({textures = {self._texture}})
end