r2133 - branches/nexuiz-2.0/data/qcsrc/server
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Sun Jan 21 04:20:24 EST 2007
Author: div0
Date: 2007-01-21 04:20:24 -0500 (Sun, 21 Jan 2007)
New Revision: 2133
Modified:
branches/nexuiz-2.0/data/qcsrc/server/g_world.qc
Log:
prevent bad map cycles
Modified: branches/nexuiz-2.0/data/qcsrc/server/g_world.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/g_world.qc 2007-01-20 21:44:30 UTC (rev 2132)
+++ branches/nexuiz-2.0/data/qcsrc/server/g_world.qc 2007-01-21 09:20:24 UTC (rev 2133)
@@ -452,16 +452,23 @@
// NOTE: this now expects the map list to be already tokenize()d and the count in Map_Count
float GetMaplistPosition()
{
- float pos;
+ float pos, idx;
string map;
map = GetMapname();
+ idx = cvar("g_maplist_index");
+
+ if(idx >= 0)
+ if(idx < Map_Count)
+ if(map == argv(idx))
+ return idx;
+
for(pos = 0; pos < Map_Count; ++pos)
if(map == argv(pos))
return pos;
// resume normal maplist rotation if current map is not in g_maplist
- return cvar("g_maplist_index");
+ return idx;
}
float MapHasRightSize(string map)
More information about the nexuiz-commits
mailing list