From 614b7a38d5eaea6588fbd9126eb747d7c78104ab Mon Sep 17 00:00:00 2001 From: Ethan Lee Date: Sun, 12 Feb 2012 00:45:07 -0500 Subject: [PATCH] - Fixed a bug in the filesystem that broke "+set game". - cddir no longer requires baseq2 at the end of the value. - Updated README to reflect above change and to correct the credits. - The shell scripts now actually accept parameters. --- doc/README | 9 ++++++--- executables/LWJake2.sh | 2 +- executables/LWJake2_Server.sh | 2 +- src/lwjake2/qcommon/FS.java | 15 ++++++++++----- src/lwjake2/qcommon/Qcommon.java | 3 +++ 5 files changed, 21 insertions(+), 10 deletions(-) diff --git a/doc/README b/doc/README index fc8531b..90c7964 100644 --- a/doc/README +++ b/doc/README @@ -39,7 +39,7 @@ need to move your baseq2/ to that folder. However, you can change this by modifying the "cddir" cvar in your config.cfg. For example, if I wanted to host my data in ~/.quake2, I would add the following to my config.cfg: -set cddir "/home/flibitijibibo/.quake2/baseq2" +set cddir "/home/flibitijibibo/.quake2" Be sure to check for "set cddir" first! LWJake2 adds this in the default config. @@ -47,12 +47,15 @@ Credits ======= Bytonic Software - Original Jake2 authors ------------- +----------------------------------------- Holger Zickner Carsten Weisse Rene Stoeckel + +Jake2 Community - Other Jake2 contributors +------------------------------------------ David Sanders - Original LWJGL implementation 12characters Games - LWJake2 authors ----------------- +------------------------------------ Ethan Lee \ No newline at end of file diff --git a/executables/LWJake2.sh b/executables/LWJake2.sh index af8233d..758ec4b 100755 --- a/executables/LWJake2.sh +++ b/executables/LWJake2.sh @@ -1,4 +1,4 @@ #!/bin/bash cd `dirname $0` export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:./ -java -jar lwjake2.jar +java -jar lwjake2.jar $@ diff --git a/executables/LWJake2_Server.sh b/executables/LWJake2_Server.sh index 2c6568f..c8d18fa 100755 --- a/executables/LWJake2_Server.sh +++ b/executables/LWJake2_Server.sh @@ -1,3 +1,3 @@ #!/bin/bash cd `dirname $0` -java -jar lwjake2.jar +set dedicated 1 \ No newline at end of file +java -jar lwjake2.jar +set dedicated 1 $@ \ No newline at end of file diff --git a/src/lwjake2/qcommon/FS.java b/src/lwjake2/qcommon/FS.java index 69d5e78..3a22086 100644 --- a/src/lwjake2/qcommon/FS.java +++ b/src/lwjake2/qcommon/FS.java @@ -925,10 +925,7 @@ public final class FS extends Globals { markBaseSearchPaths(); // check for game override - fs_gamedirvar = Cvar.Get("game", "", CVAR_LATCH | CVAR_SERVERINFO); - - if (fs_gamedirvar.string.length() > 0) - SetGamedir(fs_gamedirvar.string); + checkOverride(); } /** @@ -937,7 +934,15 @@ public final class FS extends Globals { static void setCDDir() { fs_cddir = Cvar.Get("cddir", "", CVAR_ARCHIVE); if (fs_cddir.string.length() > 0) - AddGameDirectory(fs_cddir.string); + AddGameDirectory(fs_cddir.string + '/' + Globals.BASEDIRNAME); + } + + /** Check for "+set game" override - Used to properly set gamedir */ + static void checkOverride() { + fs_gamedirvar = Cvar.Get("game", "", CVAR_LATCH | CVAR_SERVERINFO); + + if (fs_gamedirvar.string.length() > 0) + SetGamedir(fs_gamedirvar.string); } static void markBaseSearchPaths() { diff --git a/src/lwjake2/qcommon/Qcommon.java b/src/lwjake2/qcommon/Qcommon.java index 8aad8c9..2938ca6 100644 --- a/src/lwjake2/qcommon/Qcommon.java +++ b/src/lwjake2/qcommon/Qcommon.java @@ -69,11 +69,14 @@ public final class Qcommon extends Globals { Cbuf.Execute(); FS.InitFilesystem(); + + System.out.println(FS.fs_gamedir); reconfigure(false); FS.setCDDir(); // use cddir from config.cfg FS.markBaseSearchPaths(); // mark the default search paths + FS.checkOverride(); reconfigure(true); // reload default.cfg and config.cfg