From: terencehill Date: Wed, 24 Mar 2021 22:44:06 +0000 (+0100) Subject: GameCommand_moveplayer: don't break parsing other clients if a client isn't in the... X-Git-Tag: xonotic-v0.8.5~487 X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=f1cf1299b2a73cee53269f383119d2712413b32d GameCommand_moveplayer: don't break parsing other clients if a client isn't in the game; also remove redundant ", skipping to next player." from some messages --- diff --git a/qcsrc/server/command/sv_cmd.qc b/qcsrc/server/command/sv_cmd.qc index 2abd4c6d5..6ada10451 100644 --- a/qcsrc/server/command/sv_cmd.qc +++ b/qcsrc/server/command/sv_cmd.qc @@ -1002,7 +1002,7 @@ void GameCommand_moveplayer(int request, int argc) if (accepted <= 0) { - LOG_INFO("moveplayer: ", GetClientErrorString(accepted, t), (targets ? ", skipping to next player.\n" : ".")); + LOG_INFO("moveplayer: ", GetClientErrorString(accepted, t), "."); } else if (destination == "spectator") { @@ -1021,19 +1021,20 @@ void GameCommand_moveplayer(int request, int argc) } else { - string pl_name = playername(client.netname, client.team, false); - if (IS_SPEC(client) || IS_OBSERVER(client)) - { - // well technically we could, but should we allow that? :P - LOG_INFO("Can't change teams if the player isn't in the game."); - return; - } if (!teamplay) { LOG_INFO("Can't change teams when currently not playing a team game."); return; } + string pl_name = playername(client.netname, client.team, false); + if (IS_SPEC(client) || IS_OBSERVER(client)) + { + // well technically we could, but should we allow that? :P + LOG_INFO("Player ", ftos(GetFilteredNumber(t)), " (", pl_name, ") is not in the game."); + continue; + } + // set up int save = Player_GetForcedTeamIndex(client); Player_SetForcedTeamIndex(client, TEAM_FORCE_DEFAULT); @@ -1044,7 +1045,7 @@ void GameCommand_moveplayer(int request, int argc) if (team_num == client.team) // already on the destination team { // keep the forcing undone - LOG_INFO("Player ", ftos(GetFilteredNumber(t)), " (", pl_name, ") is already on the ", Team_ColoredFullName(team_num), (targets ? "^7, skipping to next player.\n" : "^7.")); + LOG_INFO("Player ", ftos(GetFilteredNumber(t)), " (", pl_name, ") is already on the ", Team_ColoredFullName(team_num), "."); continue; } else if (team_num == 0) // auto team