]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
string VoteCommand_getprefix() to distinguish between "cmd" and "sv_cmd" in
authorSamual <samual@xonotic.org>
Sat, 3 Dec 2011 06:48:34 +0000 (01:48 -0500)
committerSamual <samual@xonotic.org>
Sat, 3 Dec 2011 06:48:34 +0000 (01:48 -0500)
messages

qcsrc/server/clientcommands.qc
qcsrc/server/vote.qc

index a4f08e8dde17ecff38bfd1b232597e4166dcfc28..febaf1a62daa6b8966e00382bf658101d39dc702 100644 (file)
@@ -894,7 +894,7 @@ void ClientCommand_(float request)
        CLIENT_COMMAND("timein", ClientCommand_timein(request), "Resume the game from being paused with a timeout") \
        CLIENT_COMMAND("timeout", ClientCommand_timeout(request), "Call a timeout which pauses the game for certain amount of time unless unpaused") \
        CLIENT_COMMAND("voice", ClientCommand_voice(request, arguments, command), "Send voice message via sound") \
-       CLIENT_COMMAND("vote", VoteCommand(self, arguments), "Request an action to be voted upon by players") \ // handled in server/vote.qc
+       CLIENT_COMMAND("vote", VoteCommand(self, arguments), "Request an action to be voted upon by players") // handled in server/vote.qc \
        /* nothing */
        
 void ClientCommand_macro_help()
index 9b029e34382fa152544ca69eadca541a5a24d3c7..e3855c2d91fe25bef9ec2bdc632fdd915cbd65e8 100644 (file)
@@ -1,6 +1,6 @@
 // =============================================
 //  Server side voting code, reworked by Samual
-//  Last updated: November 30th, 2011
+//  Last updated: December 4th, 2011
 // =============================================
 
 #define VC_REQUEST_COMMAND 1
@@ -31,7 +31,13 @@ float Votecommand_check_assignment(entity caller, float assignment)
        return FALSE;
 }
 
-string VoteCommand_
+string VoteCommand_getprefix(entity caller)
+{
+       if(caller)
+               return "cmd";
+       else
+               return "sv_cmd";
+}
 
 float Nagger_SendEntity(entity to, float sendflags)
 {
@@ -440,14 +446,14 @@ void VoteCommand_(float request)
 // Do not hard code aliases for these, instead create them in commands.cfg... also: keep in alphabetical order, please ;)
 #define VOTE_COMMANDS(request,caller,arguments) \
        VOTE_COMMAND("abstain", VoteCommand_abstain(request, caller), "", VC_ASGNMNT_CLIENTONLY) \
-       VOTE_COMMAND("help", VoteCommand_help(caller), "", VC_ASGNMNT_BOTH) \
+       VOTE_COMMAND("help", VoteCommand_macro_help(caller), "", VC_ASGNMNT_BOTH) \
        VOTE_COMMAND("stop", VoteCommand_stop(request, caller), "", VC_ASGNMNT_BOTH) \
        //VOTE_COMMAND("", VoteCommand_(request, caller, arguments), "", ) \
        /* nothing */
 
 void VoteCommand_macro_help(entity caller)
 {
-       print("\nUsage:^3 cmd vote COMMAND...^7, where possible commands are:\n");
+       print("\nUsage:^3 ", VoteCommand_getprefix(caller), " vote COMMAND...^7, where possible commands are:\n");
        
        #define VOTE_COMMAND(name,function,description,assignment) \
                { if(Votecommand_check_assignment(caller, assignment)) { print("  ^2", name, "^7: ", description, "\n"); } }