string GetMapname();
string GetGametype();
-void GotoNextMap();
+void GotoNextMap(float reinit);
void ShuffleMaplist()
-float() DoNextMapOverride;
+float(float reinit) DoNextMapOverride;
void SetDefaultAlpha()
{
MapInfo_Enumerate();
MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags(), 0);
- if(!DoNextMapOverride())
- GotoNextMap();
+ if(!DoNextMapOverride(1))
+ GotoNextMap(1);
return;
}
BADPREFIX("g_ban_");
BADPREFIX("g_banned_list");
BADPREFIX("g_chat_flood_");
+ BADPREFIX("g_ghost_items");
BADPREFIX("g_playerstats_");
+ BADPREFIX("g_respawn_ghosts");
BADPREFIX("g_voice_flood_");
BADPREFIX("rcon_");
- BADPREFIX("settemp_");
- BADPREFIX("sv_allowdownloads_");
+ BADPREFIX("sv_allowdownloads");
BADPREFIX("sv_autodemo");
BADPREFIX("sv_curl_");
BADPREFIX("sv_eventlog");
BADCVAR("g_balance_kill_delay");
BADCVAR("g_ca_point_leadlimit");
BADCVAR("g_ctf_captimerecord_always");
- BADCVAR("g_ctf_capture_leadlimit");
BADCVAR("g_ctf_flag_capture_effects");
BADCVAR("g_ctf_flag_glowtrails");
BADCVAR("g_ctf_flag_pickup_effects");
BADCVAR("sv_allow_fullbright");
BADCVAR("sv_checkforpacketsduringsleep");
BADCVAR("sv_timeout");
+ BADPREFIX("sv_timeout_");
BADCVAR("welcome_message_time");
BADPREFIX("crypto_");
BADPREFIX("g_chat_");
BADCVAR("g_balance_teams_force");
BADCVAR("g_ban_sync_trusted_servers");
BADCVAR("g_ban_sync_uri");
- BADCVAR("g_ctf_capture_limit");
BADCVAR("g_ctf_ignore_frags");
- BADCVAR("g_ctf_win_mode");
BADCVAR("g_domination_point_limit");
BADCVAR("g_friendlyfire");
BADCVAR("g_fullbrightitems");
BADCVAR("sys_ticrate");
BADCVAR("teamplay_mode");
BADCVAR("timelimit_override");
+ BADCVAR("g_spawnshieldtime");
BADPREFIX("g_warmup_");
BADPREFIX("sv_ready_restart_");
self.classname = "worldspawn"; // safeguard against various stuff ;)
+ // needs to be done so early because of the constants they create
+ RegisterWeapons();
+ RegisterGametypes();
+
MapInfo_Enumerate();
MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags(), 0);
}
head = nextent(head);
}
- // needs to be done so early as they would still spawn
+ // needs to be done so early because of the constants they create
RegisterWeapons();
+ RegisterGametypes();
ServerProgsDB = db_load(strcat("server.db", autocvar_sessionid));
string GetGametype()
{
- return GametypeNameFromType(game);
+ return MapInfo_Type_ToString(MapInfo_LoadedGametype);
}
string getmapname_stored;
Map_Goto_SetStr(argv(position));
}
-void GameResetCfg()
+void Map_Goto(float reinit)
{
- // settings persist, except...
- localcmd("\nsettemp_restore\n");
-}
-
-void Map_Goto()
-{
- GameResetCfg();
- MapInfo_LoadMap(getmapname_stored);
+ MapInfo_LoadMap(getmapname_stored, reinit);
}
// return codes of map selectors:
return "";
}
-float DoNextMapOverride()
+float DoNextMapOverride(float reinit)
{
if(autocvar_g_campaign)
{
if(MapInfo_CheckMap(autocvar_nextmap))
{
Map_Goto_SetStr(autocvar_nextmap);
- Map_Goto();
+ Map_Goto(reinit);
alreadychangedlevel = TRUE;
return TRUE;
}
if(autocvar_lastlevel)
{
- GameResetCfg();
- localcmd("set lastlevel 0\ntogglemenu\n");
+ cvar_settemp_restore();
+ localcmd("set lastlevel 0\ntogglemenu 1\n");
alreadychangedlevel = TRUE;
return TRUE;
}
return FALSE;
}
-void GotoNextMap()
+void GotoNextMap(float reinit)
{
//string nextmap;
//float n, nummaps;
error("Everything is broken - not even the default map list works. Please report this to the developers.");
}
}
- Map_Goto();
+ Map_Goto(reinit);
}
}
FixClientCvars(other);
Map_Goto_SetStr(mapvote_maps[mappos]);
- Map_Goto();
+ Map_Goto(0);
alreadychangedlevel = TRUE;
return TRUE;
}
}
mapvote_initialized = TRUE;
- if(DoNextMapOverride())
+ if(DoNextMapOverride(0))
return;
if(!autocvar_g_maplist_votable || player_count <= 0)
{
- GotoNextMap();
+ GotoNextMap(0);
return;
}
MapVote_Init();
cvar_set("timelimit", "-1");
if(mapvote_initialized || alreadychangedlevel)
{
- if(DoNextMapOverride())
+ if(DoNextMapOverride(0))
return "Map switch initiated.";
else
return "Hm... no. For some reason I like THIS map more.";
TargetMusic_RestoreGame();
}
-void SV_Shutdown()
+void Shutdown()
{
entity e;
- if(gameover > 1) // shutting down already?
- return;
-
- gameover = 2; // 2 = server shutting down
+ gameover = 2;
if(world_initialized > 0)
{