diff --git a/build_game.sh b/build_game.sh index d307b50e..ae8c66d1 100755 --- a/build_game.sh +++ b/build_game.sh @@ -5,7 +5,7 @@ PATH="$SCRPATH"/bin:"$PATH" if [ -f "$SCRPATH"/bin/fteqcc ]; then export OLDDIR=$(pwd) - find -name Makefile | grep 'src\/Makefile' | grep -v engine | while read MFILE_N; do + find "$SCRPATH" -name Makefile | grep 'src\/Makefile' | grep -v engine | while read MFILE_N; do cd $(dirname $MFILE_N) make cd $OLDDIR diff --git a/src/client/entry.qc b/src/client/entry.qc index e3d7d4e9..34df3c8a 100644 --- a/src/client/entry.qc +++ b/src/client/entry.qc @@ -126,7 +126,6 @@ CSQC_RendererRestarted(string rstr) /* GS-Entbase */ Fade_Init(); - Sky_Update(); Decal_Reload(); FX_Init(); } @@ -163,6 +162,7 @@ CSQC_UpdateView(float w, float h, float focus) video_res[0] = w; video_res[1] = h; + Sky_Update(); cvar_set("_background", serverkey("background")); if (serverkeyfloat("background") == 1) { diff --git a/src/client/sky.qc b/src/client/sky.qc index ff92eb5f..1e57644a 100644 --- a/src/client/sky.qc +++ b/src/client/sky.qc @@ -14,11 +14,13 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +var string g_strSkyName; + void Sky_Update(void) { - if (serverkeyfloat("*bspversion") != BSPVER_HL) { - return; + if (g_strSkyName != serverkey("skyname")) { + g_strSkyName = serverkey("skyname"); + localcmd(sprintf("sky %s\n", g_strSkyName)); } - localcmd(sprintf("sky %s\n", g_strSkyName)); } diff --git a/src/gs-entbase/client/worldspawn.qc b/src/gs-entbase/client/worldspawn.qc index 46c98bbb..9c607025 100644 --- a/src/gs-entbase/client/worldspawn.qc +++ b/src/gs-entbase/client/worldspawn.qc @@ -22,12 +22,6 @@ var float g_flHDRIrisFadeUp = 0.1; var float g_flHDRIrisFadeDown = 0.5; var int g_iHDREnabled = 0; -#ifdef VALVE -var string g_strSkyName = "desert"; -#else -var string g_strSkyName = ""; -#endif - class worldspawn:CBaseEntity { virtual void(string, string) SpawnKey; @@ -58,9 +52,6 @@ void worldspawn::SpawnKey(string strField, string strKey) case "chaptertitle": GameMessage_Setup(strKey, 0); break; - case "skyname": - g_strSkyName = strKey; - break; case "ambientsound": if (g_ambientsound) { break; diff --git a/src/server/entry.qc b/src/server/entry.qc index e470379d..1779762a 100644 --- a/src/server/entry.qc +++ b/src/server/entry.qc @@ -368,6 +368,7 @@ initents ??? ================= */ +.string skyname; void initents(void) { @@ -459,6 +460,14 @@ initents(void) * let's add our own that we can actually trust. */ forceinfokey(world, "sv_playerslots", cvar_string("sv_playerslots")); + /* Set the default sky */ + if (serverkeyfloat("*bspversion") == BSPVER_HL) { + if (!self.skyname) { + self.skyname = "desert"; + } + forceinfokey(world, "skyname", self.skyname); + } + Plugin_InitEnts(); Mapcycle_Init(); Vote_Init();