diff options
author | Rene Stoeckel <[email protected]> | 2005-12-05 00:11:47 +0000 |
---|---|---|
committer | Rene Stoeckel <[email protected]> | 2005-12-05 00:11:47 +0000 |
commit | 8c12a9547e61079872828768117192b775663f02 (patch) | |
tree | 57944d8bb054ecb5c57e019335179daf450b1cfa /src/jake2/server/SV_INIT.java | |
parent | cb8a1184a7ca4c970a934965a9ebc26a0590eb7b (diff) |
fixed bug with ending server in coop mode (always tried to load base1)
Diffstat (limited to 'src/jake2/server/SV_INIT.java')
-rw-r--r-- | src/jake2/server/SV_INIT.java | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/src/jake2/server/SV_INIT.java b/src/jake2/server/SV_INIT.java index 63dbbd9..3d95e6a 100644 --- a/src/jake2/server/SV_INIT.java +++ b/src/jake2/server/SV_INIT.java @@ -19,7 +19,7 @@ */ // Created on 14.01.2004 by RST. -// $Id: SV_INIT.java,v 1.15 2005-12-04 23:35:20 salomo Exp $ +// $Id: SV_INIT.java,v 1.16 2005-12-05 00:11:47 salomo Exp $ package jake2.server; import jake2.Defines; @@ -391,6 +391,8 @@ public class SV_INIT { } } + private static String firstmap = ""; + /* * ====================== SV_Map * @@ -431,26 +433,25 @@ public class SV_INIT { int c = level.indexOf('+'); if (c != -1) { - Cvar.Set("nextserver", "gamemap \"" + level.substring(c + 1) - + "\""); + Cvar.Set("nextserver", "gamemap \"" + level.substring(c + 1) + "\""); level = level.substring(0, c); } else { Cvar.Set("nextserver", ""); } - // rst: base1 works for full, damo1 works for demo, so we need to check the - // dedicated_start variable - String nextlevel = "base1"; - String dedicated_start = Cvar.VariableString("dedicated_start"); - - String tmp[] = dedicated_start.split(" "); - - if (tmp.length == 2) - nextlevel = tmp[1]; + // rst: base1 works for full, damo1 works for demo, so we need to store first map. + if (firstmap.length() == 0) + { + if (!levelstring.endsWith(".cin") && !levelstring.endsWith(".pcx") && !levelstring.endsWith(".dm2")) + { + int pos = levelstring.indexOf('+'); + firstmap = levelstring.substring(pos + 1); + } + } //ZOID special hack for end game screen in coop mode if (Cvar.VariableValue("coop") != 0 && level.equals("victory.pcx")) - Cvar.Set("nextserver", "gamemap \"*" + nextlevel + "\""); + Cvar.Set("nextserver", "gamemap \"*" + firstmap + "\""); // if there is a $, use the remainder as a spawnpoint int pos = level.indexOf('$'); |