X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fcommand%2Fcmd.qc;h=e7cc3d4578c8a811d7509db00a23954ef785f50a;hb=bf28c62f9ad2f130024109354c2503457195898d;hp=3261d3eb019ae1a22fa6cbdcb3037bbad42aab07;hpb=0dbdb22db2053df47bd9c2d871540a0e42ea0521;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/command/cmd.qc b/qcsrc/server/command/cmd.qc index 3261d3eb0..e7cc3d457 100644 --- a/qcsrc/server/command/cmd.qc +++ b/qcsrc/server/command/cmd.qc @@ -1,5 +1,5 @@ -#include #include "cmd.qh" +#include #include "common.qh" #include "vote.qh" @@ -20,8 +20,9 @@ #include #include +#include #include -#include +#include #include #include #include @@ -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 @@ -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); } }