1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-12-25 02:00:37 +01:00

Add multiple textures for mobs

This commit is contained in:
Ombridride 2014-12-09 13:56:43 +01:00
parent ef566a5fe1
commit 85bd085ab8

View File

@ -10,7 +10,7 @@ function mobs:register_mob(name, def)
visual = def.visual, visual = def.visual,
visual_size = def.visual_size, visual_size = def.visual_size,
mesh = def.mesh, mesh = def.mesh,
textures = def.textures, --textures = def.textures,
makes_footstep_sound = def.makes_footstep_sound, makes_footstep_sound = def.makes_footstep_sound,
view_range = def.view_range, view_range = def.view_range,
walk_velocity = def.walk_velocity, walk_velocity = def.walk_velocity,
@ -636,8 +636,10 @@ function mobs:register_mob(name, def)
local tmp = { local tmp = {
lifetimer = self.lifetimer, lifetimer = self.lifetimer,
tamed = self.tamed, tamed = self.tamed,
textures = { textures = self.textures }, --textures = { textures = self.textures },
textures = def.available_textures["texture_"..math.random(1,def.available_textures["total"])],
} }
self.object:set_properties(tmp)
return minetest.serialize(tmp) return minetest.serialize(tmp)
end, end,