summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTenPlus1 <kinsellaja@yahoo.com>2017-02-02 13:51:51 +0000
committerTenPlus1 <kinsellaja@yahoo.com>2017-02-02 13:51:51 +0000
commit40e6eaf98ae07741136fc571bb42cc623ea6923c (patch)
treeae7df28b8f4fb017c0284070589125be4e872e52
parent62d00489b3cc224a2fff42b0a7e9b7a25b07d5a2 (diff)
fix old texture support
-rw-r--r--api.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/api.lua b/api.lua
index ed2deb7..1a8460e 100644
--- a/api.lua
+++ b/api.lua
@@ -2217,7 +2217,12 @@ local mob_activate = function(self, staticdata, dtime_s, def)
-- select random texture, set model and size
if not self.base_texture then
- self.base_texture = def.textures[random(1, #def.textures)]
+ if #def.textures == 1 then
+ self.base_texture = def.textures
+ else
+ self.base_texture = def.textures[random(1, #def.textures)]
+ end
+
self.base_mesh = def.mesh
self.base_size = self.visual_size
self.base_colbox = self.collisionbox