X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fg_world.qc;h=68532192ec213087a266572ea6b7800af1d27a5c;hb=f793281f2aba91beb14f7200ed33f1fec4d23f4e;hp=d654b91d53f0405ab82f58cf7da6a070a512a9ca;hpb=1c3d7f32e19b781dd1485c29fc347d904b4b502a;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index d654b91d5..68532192e 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -323,7 +323,6 @@ void cvar_changes_init() BADCVAR("sv_fraginfo"); BADCVAR("sv_timeout"); BADPREFIX("sv_timeout_"); - BADCVAR("welcome_message_time"); BADPREFIX("crypto_"); BADPREFIX("g_chat_"); BADPREFIX("g_ctf_captimerecord_"); @@ -1049,6 +1048,8 @@ float() MaplistMethod_Iterate = // usual method { float pass, i; + dprint("Trying MaplistMethod_Iterate\n"); + for(pass = 1; pass <= 2; ++pass) { for(i = 1; i < Map_Count; ++i) @@ -1064,6 +1065,8 @@ float() MaplistMethod_Iterate = // usual method float() MaplistMethod_Repeat = // fallback method { + dprint("Trying MaplistMethod_Repeat\n"); + if(Map_Check(Map_Current, 2)) return Map_Current; return -2; @@ -1073,6 +1076,8 @@ float() MaplistMethod_Random = // random map selection { float i, imax; + dprint("Trying MaplistMethod_Random\n"); + imax = 42; for(i = 0; i <= imax; ++i) @@ -1091,6 +1096,8 @@ float(float exponent) MaplistMethod_Shuffle = // more clever shuffling { float i, j, imax, insertpos; + dprint("Trying MaplistMethod_Shuffle\n"); + imax = 42; for(i = 0; i <= imax; ++i) @@ -1125,10 +1132,14 @@ float(float exponent) MaplistMethod_Shuffle = // more clever shuffling void Maplist_Init() { Map_Count = tokenizebyseparator(autocvar_g_maplist, " "); - if(Map_Count == 0) + float i; + for (i = 0; i < Map_Count; ++i) + if (Map_Check(i, 2)) + break; + if (i == Map_Count) { - bprint( "Maplist is empty! Resetting it to default map list.\n" ); - cvar_set("g_maplist", MapInfo_ListAllAllowedMaps(MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags())); + bprint( "Maplist contains no usable maps! Resetting it to default map list.\n" ); + cvar_set("g_maplist", MapInfo_ListAllAllowedMaps(MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags() | MAPINFO_FLAG_NOAUTOMAPLIST)); if(autocvar_g_maplist_shuffle) ShuffleMaplist(); localcmd("\nmenu_cmd sync\n"); @@ -1231,31 +1242,12 @@ void GotoNextMap(float reinit) return; alreadychangedlevel = TRUE; - { - string nextMap; - float allowReset; + string nextMap; - for(allowReset = 1; allowReset >= 0; --allowReset) - { - nextMap = GetNextMap(); - if(nextMap != "") - break; - - if(allowReset) - { - bprint( "Maplist contains no single playable map! Resetting it to default map list.\n" ); - cvar_set("g_maplist", MapInfo_ListAllAllowedMaps(MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags())); - if(autocvar_g_maplist_shuffle) - ShuffleMaplist(); - localcmd("\nmenu_cmd sync\n"); - } - else - { - error("Everything is broken - not even the default map list works. Please report this to the developers."); - } - } - Map_Goto(reinit); - } + nextMap = GetNextMap(); + if(nextMap == "") + error("Everything is broken - cannot find a next map. Please report this to the developers."); + Map_Goto(reinit); }