mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-19 09:31:07 +01:00
Make sure math.random gets a >0 argument
This commit is contained in:
parent
6d336ee879
commit
ccfbc7da14
1 changed files with 4 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue