Client/Server: Make the server control the sky.

This commit is contained in:
Marco Cawthorne 2021-02-22 17:27:22 +01:00
parent 3e13cb46ff
commit 20a67bf418
5 changed files with 16 additions and 14 deletions

View File

@ -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

View File

@ -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) {

View File

@ -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));
}

View File

@ -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;

View File

@ -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();