]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/command/getreplies.qc
Make most server includes order insensitive
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / command / getreplies.qc
index 29e817ea6249ef9c1b5293c313f6e52e53d25401..38c4bf16cac33e11779ad0d85219267e4b869a36 100644 (file)
@@ -1,3 +1,15 @@
+#include "getreplies.qh"
+#include "../_.qh"
+
+#include "../race.qh"
+
+#include "../../common/constants.qh"
+#include "../../common/counting.qh"
+#include "../../common/mapinfo.qh"
+#include "../../common/util.qh"
+
+#include "../../common/monsters/monsters.qh"
+
 // =========================================================
 //  Reply messages for common commands, re-worked by Samual
 //  Last updated: December 30th, 2011
@@ -110,13 +122,10 @@ string getrankings()
 
 string getladder()
 {
-       float i, j, k, uidcnt = 0, thiscnt;
+       int i, j, k, uidcnt = 0, thiscnt;
        string s, temp_s, rr, myuid, thisuid;
 
-       if(g_cts)
-               rr = CTS_RECORD;
-       else
-               rr = RACE_RECORD;
+       rr = (g_cts) ? CTS_RECORD : RACE_RECORD;
 
        for(k = 0; k < MapInfo_count; ++k)
        {
@@ -289,14 +298,14 @@ string getladder()
 string getmaplist()
 {
        string maplist = "", col;
-       float i, argc;
+       int i, argc;
 
        argc = tokenize_console(autocvar_g_maplist);
        for(i = 0; i < argc; ++i)
        {
                if(MapInfo_CheckMap(argv(i)))
                {
-                       if(mod(i, 2)) { col = "^2"; }
+                       if(i % 2) { col = "^2"; }
                        else { col = "^3"; }
                        maplist = sprintf("%s%s%s ", maplist, col, argv(i));
                }
@@ -323,13 +332,13 @@ string getlsmaps()
                                (g_cts && !stof(db_get(ServerProgsDB, strcat(MapInfo_Map_bspname, CTS_RECORD, "time"))))
                        )
                        {
-                               newmaps = TRUE;
-                               if(mod(i, 2)) { col = "^4*"; }
+                               newmaps = true;
+                               if(i % 2) { col = "^4*"; }
                                else { col = "^5*"; }
                        }
                        else
                        {
-                               if(mod(i, 2)) { col = "^2"; }
+                               if(i % 2) { col = "^2"; }
                                else { col = "^3"; }
                        }
 
@@ -344,11 +353,10 @@ string getlsmaps()
 string getmonsterlist()
 {
        string monsterlist = "", col;
-       float i;
 
-       for(i = MON_FIRST; i <= MON_LAST; ++i)
+       for(int i = MON_FIRST; i <= MON_LAST; ++i)
        {
-               if(mod(i, 2)) { col = "^2"; }
+               if(i % 2) { col = "^2"; }
                else { col = "^3"; }
                monsterlist = sprintf("%s%s%s ", monsterlist, col, (get_monsterinfo(i)).netname);
        }