From 73988dcc7cdae041cff3bed41afc6c5c40bdeadb Mon Sep 17 00:00:00 2001 From: "ALLEN-PC\\acj30" Date: Sat, 22 Jun 2024 02:33:19 -0500 Subject: [PATCH] Fix maps with multiple sky_cameras not using the correct sky_camera after loading a save --- sp/src/game/server/SkyCamera.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sp/src/game/server/SkyCamera.cpp b/sp/src/game/server/SkyCamera.cpp index be9716d4..f5bb2825 100644 --- a/sp/src/game/server/SkyCamera.cpp +++ b/sp/src/game/server/SkyCamera.cpp @@ -211,6 +211,11 @@ void CSkyCamera::Activate( ) } } #endif + +#ifdef MAPBASE + if (HasSpawnFlags( SF_SKY_MASTER )) + g_hActiveSkybox = this; +#endif } #ifdef MAPBASE @@ -368,9 +373,11 @@ void CSkyCamera::InputActivateSkybox( inputdata_t &inputdata ) // Deactivate that skybox pActiveSky->SetThink( NULL ); pActiveSky->SetNextThink( TICK_NEVER_THINK ); + pActiveSky->RemoveSpawnFlags( SF_SKY_MASTER ); } g_hActiveSkybox = this; + AddSpawnFlags( SF_SKY_MASTER ); if (HasSpawnFlags( SF_SKY_START_UPDATING )) InputStartUpdating( inputdata ); @@ -384,6 +391,7 @@ void CSkyCamera::InputDeactivateSkybox( inputdata_t &inputdata ) if (GetCurrentSkyCamera() == this) { g_hActiveSkybox = NULL; + RemoveSpawnFlags( SF_SKY_MASTER ); // ClientData doesn't catch this immediately CBasePlayer *pPlayer = NULL;