else
return strcat("Top ", ftos(LADDER_SIZE), " ladder rankings:\n", s);
}
+
+string getlsmaps()
+{
+ print("^1================= Executing getlsmaps()! =================\n");
+
+ string lsmaps, lsnewmaps, col;
+ float i, j, n;
+ lsmaps = "^7Maps available: ";
+ lsnewmaps = "^7Maps without a record set: ";
+ for(i = 0, j = 0; i < MapInfo_count; ++i)
+ {
+ if(MapInfo_Get_ByID(i))
+ if not(MapInfo_Map_flags & MapInfo_ForbiddenFlags())
+ {
+ if(mod(i, 2))
+ col = "^2";
+ else
+ col = "^3";
+
+ ++j;
+
+ lsmaps = strcat(lsmaps, col, MapInfo_Map_bspname, " ");
+
+ if(g_race && !stof(db_get(ServerProgsDB, strcat(MapInfo_Map_bspname, RACE_RECORD, "time"))))
+ lsnewmaps = strcat(lsnewmaps, col, MapInfo_Map_bspname, " ");
+ else if(g_cts && !stof(db_get(ServerProgsDB, strcat(MapInfo_Map_bspname, CTS_RECORD, "time"))))
+ lsnewmaps = strcat(lsnewmaps, col, MapInfo_Map_bspname, " ");
+ }
+ }
+
+ lsmaps = strzone(strcat(lsmaps, "\n"));
+ lsnewmaps = strzone(strcat(((!g_race && !g_cts) ? "Need to be playing race or CTS for lsnewmaps to work." : lsnewmaps), "\n"));
+
+ maplist_reply = "^7Maps in list: ";
+ n = tokenize_console(autocvar_g_maplist);
+ for(i = 0, j = 0; i < n; ++i)
+ {
+ if(MapInfo_CheckMap(argv(i)))
+ {
+ if(mod(j, 2))
+ col = "^2";
+ else
+ col = "^3";
+ maplist_reply = strcat(maplist_reply, col, argv(i), " ");
+ ++j;
+ }
+ }
+ maplist_reply = strzone(strcat(maplist_reply, "\n"));
+ MapInfo_ClearTemps();
+ return lsmaps;
+}
void spawnfunc_worldspawn (void)
{
float fd, l, i, j, n;
- string s, col;
+ string s;
cvar = cvar_normal;
cvar_string = cvar_string_normal;
detect_maptype();
// set up information replies for clients and server to use
- lsmaps_reply = "^7Maps available: ";
- lsnewmaps_reply = "^7Maps without a record set: ";
- for(i = 0, j = 0; i < MapInfo_count; ++i)
- {
- if(MapInfo_Get_ByID(i))
- if not(MapInfo_Map_flags & MapInfo_ForbiddenFlags())
- {
- if(mod(i, 2))
- col = "^2";
- else
- col = "^3";
-
- ++j;
-
- lsmaps_reply = strcat(lsmaps_reply, col, MapInfo_Map_bspname, " ");
-
- if(g_race && !stof(db_get(ServerProgsDB, strcat(MapInfo_Map_bspname, RACE_RECORD, "time"))))
- lsnewmaps_reply = strcat(lsnewmaps_reply, col, MapInfo_Map_bspname, " ");
- else if(g_cts && !stof(db_get(ServerProgsDB, strcat(MapInfo_Map_bspname, CTS_RECORD, "time"))))
- lsnewmaps_reply = strcat(lsnewmaps_reply, col, MapInfo_Map_bspname, " ");
- }
- }
-
- lsmaps_reply = strzone(strcat(lsmaps_reply, "\n"));
- lsnewmaps_reply = strzone(strcat(((!g_race && !g_cts) ? "Need to be playing race or CTS for lsnewmaps to work." : lsnewmaps_reply), "\n"));
-
- maplist_reply = "^7Maps in list: ";
- n = tokenize_console(autocvar_g_maplist);
- for(i = 0, j = 0; i < n; ++i)
- {
- if(MapInfo_CheckMap(argv(i)))
- {
- if(mod(j, 2))
- col = "^2";
- else
- col = "^3";
- maplist_reply = strcat(maplist_reply, col, argv(i), " ");
- ++j;
- }
- }
- maplist_reply = strzone(strcat(maplist_reply, "\n"));
- MapInfo_ClearTemps();
-
+ lsmaps_reply = strzone(getlsmaps());
for(i = 0; i < 10; ++i)
{
s = getrecords(i);
if (s)
records_reply[i] = strzone(s);
}
-
ladder_reply = strzone(getladder());
-
rankings_reply = strzone(getrankings());
// begin other init
if(autocvar_g_campaign)
CampaignPreIntermission();
+ // update lsmaps in case the gametype changed, this way people can easily list maps for it
+ if(lsmaps_reply != "") { strunzone(lsmaps_reply); }
+ lsmaps_reply = strzone(getlsmaps());
+
MUTATOR_CALLHOOK(MatchEnd);
localcmd("\nsv_hook_gameend\n");