From: Mario Date: Fri, 2 Aug 2019 08:56:46 +0000 (+1000) Subject: Fix a few warnings when g_maplist is empty X-Git-Tag: xonotic-v0.8.5~1431 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=c22038abdfd83ca05144b972680a75c67f4c5e6f;p=xonotic%2Fxonotic-data.pk3dir.git Fix a few warnings when g_maplist is empty --- diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index 07027875e..5b34926fc 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -1202,11 +1202,17 @@ float MaplistMethod_Shuffle(float exponent) // more clever shuffling void Maplist_Init() { - Map_Count = tokenizebyseparator(autocvar_g_maplist, " "); - float i; - for (i = 0; i < Map_Count; ++i) - if (Map_Check(i, 2)) - break; + float i = Map_Count = 0; + if(autocvar_g_maplist != "") + { + Map_Count = tokenizebyseparator(autocvar_g_maplist, " "); + for (i = 0; i < Map_Count; ++i) + { + if (Map_Check(i, 2)) + break; + } + } + if (i == Map_Count) { bprint( "Maplist contains no usable maps! Resetting it to default map list.\n" );