From 16a89e6938e5276fa8923bd86db8f369f39a3e80 Mon Sep 17 00:00:00 2001 From: blackhc Date: Wed, 8 Jun 2005 21:41:35 +0000 Subject: [PATCH] Added method 0 which uses two cvars g_maplist and g_maplist_index, please test it. git-svn-id: svn://svn.icculus.org/nexuiz/trunk@438 f962a42d-fe04-0410-a3ab-8c8b0445ebaa --- qcsrc/gamec/g_world.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/qcsrc/gamec/g_world.c b/qcsrc/gamec/g_world.c index 2eef3752b..4fb45f921 100644 --- a/qcsrc/gamec/g_world.c +++ b/qcsrc/gamec/g_world.c @@ -143,8 +143,8 @@ void worldspawn (void) // plays music for the level if there is any if (self.noise) { - precache_sound (self.noise); - ambientsound ('0 0 0', self.noise, 1.00, ATTN_NONE); + precache_sound (self.noise); + ambientsound ('0 0 0', self.noise, 1.00, ATTN_NONE); } // 0 normal @@ -288,7 +288,7 @@ float alreadychangedlevel; void() GotoNextMap = { - local string nextmap; + //local string nextmap; //local float n, nummaps; //local string s; if (alreadychangedlevel) @@ -298,6 +298,21 @@ void() GotoNextMap = changelevel (mapname); else { + // method 0 + local float lCurrent; + local float lSize; + + lSize = tokenize( cvar_string( "g_maplist" ) ); + lCurrent = cvar( "g_maplist_index" ); + + lCurrent = lCurrent + 1; + if( lCurrent >= lSize ) { + lCurrent = 0; + } + + cvar_set( "g_maplist_index", ftos( lCurrent ) ); + changelevel( argv( lCurrent ) ); + /* // method 1 //local entity pos; @@ -332,7 +347,7 @@ void() GotoNextMap = fclose(fh); } changelevel (nextmap); - strunzone(nextmap); + strunzone(nextmap);*/ // method 2 //nextmap = Nex_RotateMapList(); -- 2.39.2