]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix client commands some more, plus other updates
authorSamual <samual@xonotic.org>
Sun, 6 Nov 2011 17:33:42 +0000 (12:33 -0500)
committerSamual <samual@xonotic.org>
Sun, 6 Nov 2011 17:33:42 +0000 (12:33 -0500)
qcsrc/server/clientcommands.qc
qcsrc/server/gamecommand.qc

index 00838a431ba1dcbb1a653250db66431d97ded659..4d421ff204dbbe1c93c408b987e6a74fa24dbebf 100644 (file)
@@ -1007,7 +1007,7 @@ void ClientCommand_(float request)
 
 // For now, the list has to be split up due to the suckage called fteqcc which limits macros to only 1024 characters
 // Do not hard code aliases for these, instead create them in defaultXonotic.cfg... also: keep in alphabetical order, please ;)
-#define CLIENT_COMMANDS_1(request,arguments) \
+#define CLIENT_COMMANDS_1(request,arguments,command) \
        CLIENT_COMMAND("autoswitch", ClientCommand_autoswitch(request, arguments)) \
        CLIENT_COMMAND("checkfail", ClientCommand_checkfail(request, command)) \
        CLIENT_COMMAND("clientversion", ClientCommand_clientversion(request, arguments)) \
@@ -1023,7 +1023,7 @@ void ClientCommand_(float request)
        CLIENT_COMMAND("ready", ClientCommand_ready(request)) \
        /* nothing */
        
-#define CLIENT_COMMANDS_2(request,arguments) \
+#define CLIENT_COMMANDS_2(request,arguments,command) \
        CLIENT_COMMAND("records", ClientCommand_records(request)) \
        CLIENT_COMMAND("reportcvar", ClientCommand_reportcvar(request, arguments, command)) \
        CLIENT_COMMAND("say", ClientCommand_say(request, arguments, command)) \
@@ -1036,34 +1036,40 @@ void ClientCommand_(float request)
        CLIENT_COMMAND("tell", ClientCommand_tell(request, arguments, command)) \
        CLIENT_COMMAND("timein", ClientCommand_timein(request)) \
        CLIENT_COMMAND("timeout", ClientCommand_timeout(request)) \
+       /* nothing */
+
+#define CLIENT_COMMANDS_3(request,arguments,command) \
        CLIENT_COMMAND("voice", ClientCommand_voice(request, arguments, command)) \
        /* nothing */
        
 void ClientCommand_macro_help()
 {
        #define CLIENT_COMMAND(name,function) function;
-       CLIENT_COMMANDS_1(CC_REQUEST_HELP, 0)
-       CLIENT_COMMANDS_2(CC_REQUEST_HELP, 0)
+       CLIENT_COMMANDS_1(CC_REQUEST_HELP, 0, "")
+       CLIENT_COMMANDS_2(CC_REQUEST_HELP, 0, "")
+       CLIENT_COMMANDS_3(CC_REQUEST_HELP, 0, "")
        #undef CLIENT_COMMAND
        
        return;
 }
 
-float ClientCommand_macro_command(float argc)
+float ClientCommand_macro_command(float argc, string command)
 {
        #define CLIENT_COMMAND(name,function) if(name == strtolower(argv(0))) { function; return TRUE; } 
-       CLIENT_COMMANDS_1(CC_REQUEST_COMMAND, argc)
-       CLIENT_COMMANDS_2(CC_REQUEST_COMMAND, argc)
+       CLIENT_COMMANDS_1(CC_REQUEST_COMMAND, argc, command)
+       CLIENT_COMMANDS_2(CC_REQUEST_COMMAND, argc, command)
+       CLIENT_COMMANDS_3(CC_REQUEST_COMMAND, argc, command)
        #undef CLIENT_COMMAND
        
        return FALSE;
 }
 
-float ClientCommand_macro_usage(float argc)
+float ClientCommand_macro_usage(float argc, string command)
 {
        #define CLIENT_COMMAND(name,function) if(name == strtolower(argv(1))) { function; return TRUE; }
-       CLIENT_COMMANDS_1(CC_REQUEST_USAGE, argc)
-       CLIENT_COMMANDS_2(CC_REQUEST_USAGE, argc)
+       CLIENT_COMMANDS_1(CC_REQUEST_USAGE, argc, command)
+       CLIENT_COMMANDS_2(CC_REQUEST_USAGE, argc, command)
+       CLIENT_COMMANDS_3(CC_REQUEST_USAGE, argc, command)
        #undef CLIENT_COMMAND
        
        return FALSE;
@@ -1107,7 +1113,7 @@ void SV_ParseClientCommand(string command)
                        sprint(self, "For help about specific commands, type cmd help COMMAND\n");
                        return;
                } 
-               else if(ClientCommand_macro_usage(argc)) // Instead of trying to call a command, we're going to see detailed information about it
+               else if(ClientCommand_macro_usage(argc, command)) // Instead of trying to call a command, we're going to see detailed information about it
                {
                        return;
                }
@@ -1128,7 +1134,7 @@ void SV_ParseClientCommand(string command)
        {
                return; // handled by server/cheats.qc
        }
-       else if(ClientCommand_macro_command(argc)) // continue as usual and scan for normal commands
+       else if(ClientCommand_macro_command(argc, command)) // continue as usual and scan for normal commands
        {
                return; // handled by one of the above GameCommand_* functions
        }
index 91efa021646f25b2769d8412868ad46747551071..afb8af6da050da345080eab62619e3cf55a72a4b 100644 (file)
@@ -239,7 +239,7 @@ void GameCommand_allspec(float request, float argc)
        }
 }
 
-void GameCommand_anticheat(float request, float argc) // FIXME: player entity is never found
+void GameCommand_anticheat(float request, float argc)
 {
        switch(request)
        {
@@ -259,7 +259,7 @@ void GameCommand_anticheat(float request, float argc) // FIXME: player entity is
                                return;
                        }
                        client = edict_num(entno);
-                       if(clienttype(client) != CLIENTTYPE_REAL && clienttype(client) != CLIENTTYPE_BOT) {
+                       if(clienttype(client) != CLIENTTYPE_REAL || clienttype(client) != CLIENTTYPE_BOT) {
                                print("Player ", client.netname, " is not active\n");
                                return;
                        }