From 0f224d668751287f474284a92eab5774826eee4c Mon Sep 17 00:00:00 2001 From: div0 Date: Sat, 9 Dec 2006 09:33:12 +0000 Subject: [PATCH] check map name from g_maplist too git-svn-id: svn://svn.icculus.org/nexuiz/trunk@2022 f962a42d-fe04-0410-a3ab-8c8b0445ebaa --- data/qcsrc/server/g_world.qc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/data/qcsrc/server/g_world.qc b/data/qcsrc/server/g_world.qc index 5dd13406b..960cfb5d0 100644 --- a/data/qcsrc/server/g_world.qc +++ b/data/qcsrc/server/g_world.qc @@ -431,6 +431,7 @@ string GetMapname() } float Map_Count, Map_Current; +string Map_Current_Name; // NOTE: this now expects the map list to be already tokenize()d and the count in Map_Count float GetMaplistPosition() @@ -488,9 +489,8 @@ float(float position, float pass) Map_Check = string map_current; string map_next; map_next = argv(position); - map_current = GetMapname(); if(pass <= 1) - if(map_next == map_current) // same map again in first pass? + if(map_next == Map_Current_Name) // same map again in first pass? return 0; filename = Map_Filename(position); if(TryFile(filename)) @@ -609,6 +609,10 @@ void() Maplist_Init = if(Map_Count == 0) error("empty maplist, cannot select a new map"); Map_Current = bound(0, GetMaplistPosition(), Map_Count - 1); + + Map_Current_Name = strzone(argv(Map_Current)); // will be automatically freed on exit thanks to DP + // this may or may not be correct, but who cares, in the worst case a map + // isn't chosen in the first pass that should have been } void() GotoNextMap = -- 2.39.2