]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/command/cmd.qc
Merge branch 'master' into terencehill/translate_colors_2
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / command / cmd.qc
index 1900989e663f3c0bf50b731bfdf68bb7a87af90b..e7cc3d4578c8a811d7509db00a23954ef785f50a 100644 (file)
@@ -1,5 +1,5 @@
-#include <common/command/command.qh>
 #include "cmd.qh"
+#include <common/command/command.qh>
 
 #include "common.qh"
 #include "vote.qh"
@@ -20,8 +20,9 @@
 
 #include <common/constants.qh>
 #include <common/deathtypes/all.qh>
+#include <common/effects/all.qh>
 #include <common/mapinfo.qh>
-#include <common/notifications.qh>
+#include <common/notifications/all.qh>
 #include <common/physics/player.qh>
 #include <common/teams.qh>
 #include <common/util.qh>
@@ -116,7 +117,7 @@ void ClientCommand_clientversion(float request, float argc)  // internal command
                                        }
                                        else if (teamplay && !autocvar_sv_spectate && !(self.team_forced > 0))
                                        {
-                                               self.classname = STR_OBSERVER;  // really?
+                                               TRANSMUTE(Observer, self);  // really?
                                                stuffcmd(self, "menu_showteamselect\n");
                                        }
                                }
@@ -176,11 +177,11 @@ void ClientCommand_join(float request)
                                        if (self.caplayer) return;
                                        if (nJoinAllowed(self, self))
                                        {
-                                               if (autocvar_g_campaign)   campaign_bots_may_start = 1;
-                                               self.classname = STR_PLAYER;
+                                               if (autocvar_g_campaign)   campaign_bots_may_start = true;
+                                               TRANSMUTE(Player, self);
                                                PlayerScore_Clear(self);
-                                               Kill_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER_CPID, CPID_PREVENT_JOIN);
-                                               Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_JOIN_PLAY, self.netname);
+                                               Kill_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER, CPID_PREVENT_JOIN);
+                                               Send_Notification(NOTIF_ALL, world, MSG_INFO, ((teamplay && self.team != -1) ? APP_TEAM_ENT(this, INFO_JOIN_PLAY_TEAM) : INFO_JOIN_PLAY), self.netname);
                                                PutClientInServer();
                                        }
                                        else
@@ -372,7 +373,7 @@ void ClientCommand_selectteam(float request, float argc)
 
                                                                if (selection)
                                                                {
-                                                                       if (self.team == selection && self.deadflag == DEAD_NO)
+                                                                       if (self.team == selection && !IS_DEAD(self))
                                                                        {
                                                                                sprint(self, "^7You already are on that team.\n");
                                                                        }
@@ -470,7 +471,7 @@ void ClientCommand_sentcvar(float request, float argc, string command)
                                        tokenize_console(s);
                                }
 
-                               GetCvars(1);
+                               GetCvars(this, 1);
 
                                return;
                        }
@@ -732,7 +733,7 @@ void SV_ParseClientCommand(string command)
        if (command != command2) return;
 
        // if we're banned, don't even parse the command
-       if (Ban_MaybeEnforceBanOnce(self)) return;
+       if (Ban_MaybeEnforceBanOnce(this)) return;
 
        float argc = tokenize_console(command);
 
@@ -764,17 +765,17 @@ void SV_ParseClientCommand(string command)
        {
                if (argc == 1)
                {
-                       sprint(self, "\nClient networked commands:\n");
+                       sprint(this, "\nClient networked commands:\n");
                        ClientCommand_macro_help();
 
-                       sprint(self, "\nCommon networked commands:\n");
-                       CommonCommand_macro_help(self);
+                       sprint(this, "\nCommon networked commands:\n");
+                       CommonCommand_macro_help(this);
 
-                       sprint(self, "\nUsage:^3 cmd COMMAND...^7, where possible commands are listed above.\n");
-                       sprint(self, "For help about a specific command, type cmd help COMMAND\n");
+                       sprint(this, "\nUsage:^3 cmd COMMAND...^7, where possible commands are listed above.\n");
+                       sprint(this, "For help about a specific command, type cmd help COMMAND\n");
                        return;
                }
-               else if (CommonCommand_macro_usage(argc, self))  // Instead of trying to call a command, we're going to see detailed information about it
+               else if (CommonCommand_macro_usage(argc, this))  // Instead of trying to call a command, we're going to see detailed information about it
                {
                        return;
                }
@@ -791,7 +792,7 @@ void SV_ParseClientCommand(string command)
        {
                return;  // handled by server/cheats.qc
        }
-       else if (CommonCommand_macro_command(argc, self, command))
+       else if (CommonCommand_macro_command(argc, this, command))
        {
                return;                                          // handled by server/command/common.qc
        }
@@ -801,6 +802,6 @@ void SV_ParseClientCommand(string command)
        }
        else
        {
-               clientcommand(self, command);
+               clientcommand(this, command);
        }
 }