]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/command/getreplies.qc
Clean up macros
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / command / getreplies.qc
index a55e0e0cd28706f7199c06db12aae058a02c1dbc..dd57b2645f806ac9f672d5879175b9770482eace 100644 (file)
@@ -113,10 +113,7 @@ string getladder()
        float 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)
        {
@@ -296,7 +293,7 @@ string getmaplist()
        {
                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 +320,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"; }
                        }
 
@@ -338,5 +335,20 @@ string getlsmaps()
        }
 
        MapInfo_ClearTemps();
-       return sprintf("^7Maps available%s: %s\n", (newmaps ? " (New maps have asterisks marked in blue)" : ""), lsmaps);
+       return sprintf("^7Maps available (%d)%s: %s\n", tokenize_console(lsmaps), (newmaps ? " (New maps have asterisks marked in blue)" : ""), lsmaps);
+}
+
+string getmonsterlist()
+{
+       string monsterlist = "", col;
+       float i;
+
+       for(i = MON_FIRST; i <= MON_LAST; ++i)
+       {
+               if(i % 2) { col = "^2"; }
+               else { col = "^3"; }
+               monsterlist = sprintf("%s%s%s ", monsterlist, col, (get_monsterinfo(i)).netname);
+       }
+
+       return sprintf("^7Monsters available: %s\n", monsterlist);
 }