forked from nalc/nalc_game
Player_api: Various maintenance (#2737)
Clear 'player_sneak' and 'player_api.player_attached' table values when player leaves. Remove unnecessary commas and whitespace. Fix table name in 'game_api.txt'. Clean up documentation in 'game_api.txt'.
This commit is contained in:
@ -68,7 +68,7 @@ function player_api.set_textures(player, textures)
|
||||
local model = models[player_model[name]]
|
||||
local model_textures = model and model.textures or nil
|
||||
player_textures[name] = textures or model_textures
|
||||
player:set_properties({textures = textures or model_textures,})
|
||||
player:set_properties({textures = textures or model_textures})
|
||||
end
|
||||
|
||||
function player_api.set_animation(player, anim_name, speed)
|
||||
@ -90,6 +90,8 @@ minetest.register_on_leaveplayer(function(player)
|
||||
player_model[name] = nil
|
||||
player_anim[name] = nil
|
||||
player_textures[name] = nil
|
||||
player_sneak[name] = nil
|
||||
player_api.player_attached[name] = nil
|
||||
end)
|
||||
|
||||
-- Localize for better performance.
|
||||
|
@ -5,7 +5,7 @@ dofile(minetest.get_modpath("player_api") .. "/api.lua")
|
||||
-- Default player appearance
|
||||
player_api.register_model("character.b3d", {
|
||||
animation_speed = 30,
|
||||
textures = {"character.png", },
|
||||
textures = {"character.png"},
|
||||
animations = {
|
||||
-- Standard animations.
|
||||
stand = {x = 0, y = 79},
|
||||
|
Reference in New Issue
Block a user