Player API: Integrate settable player step height

Split some long lines.
Some nearby code cleanup.
This commit is contained in:
paramat 2017-08-07 04:27:19 +01:00 committed by paramat
parent 3294a2a515
commit 77c9408721
3 changed files with 22 additions and 12 deletions

View file

@ -44,15 +44,17 @@ function player_api.set_model(player, model_name)
mesh = model_name,
textures = player_textures[name] or model.textures,
visual = "mesh",
visual_size = model.visual_size or {x=1, y=1},
visual_size = model.visual_size or {x = 1, y = 1},
collisionbox = model.collisionbox or {-0.3, 0.0, -0.3, 0.3, 1.77, 0.3},
stepheight = model.stepheight or 0.6,
})
player_api.set_animation(player, "stand")
else
player:set_properties({
textures = { "player.png", "player_back.png", },
textures = {"player.png", "player_back.png"},
visual = "upright_sprite",
collisionbox = {-0.3, 0.0, -0.3, 0.3, 1.75, 0.3},
stepheight = 0.6,
})
end
player_model[name] = model_name