+// LordHavoc: because we don't want to load things before the video starts,
+// we have to delay map and game loads until AFTER video is initialized
+void Host_PerformSpawnServerAndLoadGame(void)
+{
+ if (vid_hidden && cls.state != ca_dedicated)
+ return;
+ if (sv_loadgame[0])
+ Host_PerformLoadGame(sv_loadgame);
+ else if (sv_spawnmap[0])
+ {
+ allowcheats = sv_cheats.integer != 0;
+ SV_SpawnServer(sv_spawnmap);
+ }
+ sv_loadgame[0] = 0;
+ sv_spawnmap[0] = 0;
+ if (sv.active && cls.state == ca_disconnected)
+ Cbuf_AddText ("connect local");
+}
+
+static void MaxPlayers_f(void)
+{
+ int n;
+
+ if (Cmd_Argc() != 2)
+ {
+ Con_Printf("\"maxplayers\" is \"%u\"\n", svs.maxclients);
+ return;
+ }
+
+ if (sv.active)
+ {
+ Con_Printf("maxplayers can not be changed while a server is running.\n");
+ return;
+ }
+
+ n = atoi(Cmd_Argv(1));
+ n = bound(1, n, MAX_SCOREBOARD);
+ Con_Printf ("\"maxplayers\" set to \"%u\"\n", n);
+
+ if (svs.clients)
+ Mem_Free(svs.clients);
+ svs.maxclients = n;
+ svs.clients = Mem_Alloc(sv_clients_mempool, sizeof(client_t) * svs.maxclients);
+ if (n == 1)
+ Cvar_Set ("deathmatch", "0");
+ else
+ Cvar_Set ("deathmatch", "1");
+}
+