From c22038abdfd83ca05144b972680a75c67f4c5e6f Mon Sep 17 00:00:00 2001 From: Mario Date: Fri, 2 Aug 2019 18:56:46 +1000 Subject: [PATCH] Fix a few warnings when g_maplist is empty --- qcsrc/server/g_world.qc | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) 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" ); -- 2.39.2