From 6f43c92929be4841047295d76e547399ab35f247 Mon Sep 17 00:00:00 2001 From: Samual Date: Thu, 1 Dec 2011 04:10:29 -0500 Subject: [PATCH] Commiting some more work on vote updates as i'm going to sleep :D --- qcsrc/server/clientcommands.qc | 4 ++-- qcsrc/server/vote.qc | 33 +++++++++++++++++++-------------- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/qcsrc/server/clientcommands.qc b/qcsrc/server/clientcommands.qc index ffe596312..a4f08e8dd 100644 --- a/qcsrc/server/clientcommands.qc +++ b/qcsrc/server/clientcommands.qc @@ -839,7 +839,7 @@ void ClientCommand_voice(float request, float argc, string command) } /* use this when creating a new command, making sure to place it in alphabetical order. -void ClientCommand_(float request)ClientCommand_getmapvotepic(request, arguments) +void ClientCommand_(float request) { switch(request) { @@ -894,7 +894,7 @@ void ClientCommand_(float request)ClientCommand_getmapvotepic(request, arguments 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") \ + 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() diff --git a/qcsrc/server/vote.qc b/qcsrc/server/vote.qc index e0d4a469a..9b029e343 100644 --- a/qcsrc/server/vote.qc +++ b/qcsrc/server/vote.qc @@ -15,6 +15,24 @@ // Misc. Supporting Functions // ============================ +float Votecommand_check_assignment(entity caller, float assignment) +{ + float from_server = (!caller); + + if((assignment == VC_ASGNMNT_BOTH) + || ((!from_server && assignment == VC_ASGNMNT_CLIENTONLY) + || (from_server && assignment == VC_ASGNMNT_SERVERONLY))) + { + print("check_assignment returned true\n"); + return TRUE; + } + + print("check_assignment returned false\n"); + return FALSE; +} + +string VoteCommand_ + float Nagger_SendEntity(entity to, float sendflags) { float nags, i, f, b; @@ -422,24 +440,11 @@ 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("stop", VoteCommand_stop(request, caller), "", VC_ASGNMNT_BOTH) \ //VOTE_COMMAND("", VoteCommand_(request, caller, arguments), "", ) \ /* nothing */ -float Votecommand_check_assignment(entity caller, float assignment) -{ - float from_server = (!caller); - - if((assignment == VC_ASGNMNT_BOTH) - || ((!from_server && assignment == VC_ASGNMNT_CLIENTONLY) - || (from_server && assignment == VC_ASGNMNT_SERVERONLY))) - { - return TRUE; - } - - return FALSE; -} - void VoteCommand_macro_help(entity caller) { print("\nUsage:^3 cmd vote COMMAND...^7, where possible commands are:\n"); -- 2.39.2