]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/command/cmd.qc
Merge branch 'Lyberta/TeamplayOverhaul2' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / command / cmd.qc
index bdfc52da0e16544961da36215d7d87f7e209624c..915fea7ee0ca2ca02ffb14d9341d539b4b4a7d14 100644 (file)
@@ -13,6 +13,7 @@
 #include "../campaign.qh"
 #include "../cheats.qh"
 #include "../client.qh"
+#include "../clientkill.qh"
 #include "../player.qh"
 #include "../ipban.qh"
 #include "../mapvoting.qh"
@@ -120,7 +121,7 @@ void ClientCommand_clientversion(entity caller, int request, int argc)  // inter
                                        {
                                                // JoinBestTeam(caller, false, true);
                                        }
-                                       else if (teamplay && !autocvar_sv_spectate && !(caller.team_forced > 0))
+                                       else if (teamplay && !autocvar_sv_spectate && !(Player_GetForcedTeamIndex(caller) > 0))
                                        {
                                                TRANSMUTE(Observer, caller);  // really?
                                                stuffcmd(caller, "menu_showteamselect\n");
@@ -362,19 +363,7 @@ void ClientCommand_say_team(entity caller, int request, int argc, string command
                case CMD_REQUEST_COMMAND:
                {
                        if (argc >= 2)
-                       {
-                               string _classname = string_null;
-                               if (!IS_PLAYER(caller) && caller.caplayer)
-                               {
-                                       // CA: make work team chat for killed players
-                                       _classname = caller.classname;
-                                       caller.classname = STR_PLAYER;
-                               }
-
                                Say(caller, true, NULL, substring(command, argv_start_index(1), argv_end_index(-1) - argv_start_index(1)), 1);
-                               if (_classname)
-                                       caller.classname = _classname;
-                       }
                        return;  // never fall through to usage
                }
 
@@ -408,7 +397,7 @@ void ClientCommand_selectteam(entity caller, int request, int argc)
                                sprint(caller, "^7selectteam can only be used in teamgames\n");
                                return;
                        }
-                       if (caller.team_forced > 0)
+                       if (Player_GetForcedTeamIndex(caller) > 0)
                        {
                                sprint(caller, "^7selectteam can not be used as your team is forced\n");
                                return;