]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/command/vote.qc
Merge branch 'master' into Mario/qc_updates
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / command / vote.qc
index 79925fc4e58070dbe09837256ba2b45bea554808..6edccafb156f8a48a40a325ff67438b533c88282 100644 (file)
@@ -1,3 +1,25 @@
+#if defined(CSQC)
+#elif defined(MENUQC)
+#elif defined(SVQC)
+       #include "../../dpdefs/progsdefs.qh"
+    #include "../../dpdefs/dpextensions.qh"
+    #include "../../common/constants.qh"
+    #include "../../common/util.qh"
+    #include "../../common/command/shared_defs.qh"
+    #include "../autocvars.qh"
+    #include "../constants.qh"
+    #include "../defs.qh"
+    #include "../../common/notifications.qh"
+    #include "../mutators/mutators_include.qh"
+    #include "../../common/mapinfo.qh"
+    #include "common.qh"
+    #include "vote.qh"
+    #include "../../common/playerstats.qh"
+    #include "../scores.qh"
+    #include "../race.qh"
+    #include "../round_handler.qh"
+#endif
+
 // =============================================
 //  Server side voting code, reworked by Samual
 //  Last updated: December 27th, 2011
@@ -6,7 +28,7 @@
 //  Nagger for players to know status of voting
 float Nagger_SendEntity(entity to, float sendflags)
 {
-       float nags, i, f, b;
+       int nags, i, f, b;
        entity e;
        WriteByte(MSG_ENTITY, ENT_CLIENT_NAGGER);
 
@@ -615,7 +637,7 @@ float VoteCommand_checkargs(float startpos, float argc)
 
        p = strstrofs(cmdrestriction, ";", 0); // find first semicolon
 
-       for(0;;)
+       for (;;)
        {
                // we know that at any time, startpos <= argc - minargs
                // so this means: argc-minargs >= startpos >= argc, thus
@@ -792,6 +814,7 @@ void VoteCommand_call(float request, entity caller, float argc, string vote_comm
                        else if(!autocvar_sv_vote_gamestart && time < game_starttime) { print_to(caller, "^1Vote calling is not allowed before the match has started."); }
                        else if(vote_called) { print_to(caller, "^1There is already a vote called."); }
                        else if(!spectators_allowed && (caller && !IS_PLAYER(caller))) { print_to(caller, "^1Only players can call a vote."); }
+                       else if(caller && !IS_CLIENT(caller)) { print_to(caller, "^1Only connected clients can vote."); }
                        else if(timeout_status) { print_to(caller, "^1You can not call a vote while a timeout is active."); }
                        else if(caller && (time < caller.vote_waittime)) { print_to(caller, strcat("^1You have to wait ^2", ftos(ceil(caller.vote_waittime - time)), "^1 seconds before you can again call a vote.")); }
                        else if (!VoteCommand_checknasty(vote_command)) { print_to(caller, "^1Syntax error in command, see 'vhelp' for more info."); }