From 59d220f9a2716be8e5e7da0ba803d334481e8983 Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Wed, 30 Mar 2016 00:39:22 +0100 Subject: [PATCH] Fix some typos --- ctf/teams.lua | 9 +++++---- ctf_colors/gui.lua | 5 +++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/ctf/teams.lua b/ctf/teams.lua index 771a388..aa73298 100644 --- a/ctf/teams.lua +++ b/ctf/teams.lua @@ -90,13 +90,14 @@ function ctf.count_players_in_team(team) end function ctf.new_player(name) - if not name then + if name then + ctf.players[name] = { + name = name + } + else ctf.error("team", "Can't create a blank player") ctf.log("team", debug.traceback()) end - ctf.players[name] = { - name = name - } end -- get a player diff --git a/ctf_colors/gui.lua b/ctf_colors/gui.lua index e6f8307..6ff5033 100644 --- a/ctf_colors/gui.lua +++ b/ctf_colors/gui.lua @@ -27,10 +27,11 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) -- Settings page if fields.save then - ctf.gui.show(name, "settings") - + local name = player:get_player_name() local pdata = ctf.player(name) local team = ctf.team(pdata.team) + + ctf.gui.show(name, "settings") if team and ctf.can_mod(name, pdata.team) then if ctf.flag_colors[fields.color] then team.data.color = fields.color