[no gbp] Fixes runtime in SSstation (#77231)

No excuse, just dumb. Random layer is the randomly generated parallax
layer, which is null 30% of the time, so this would runtime in SSstation
setup in 30% of rounds

Also another thing where I added extra params and didn't add them to the
proc, fucking parallax for some roundstart clients and latejoins

🆑
fix: fixes a runtime in SSstation setup
fix: fixes parallax not rendering correctly for latejoins
/🆑


![image](https://github.com/tgstation/tgstation/assets/7501474/650242f7-bc33-49eb-98d9-d8e3619ab808)
This commit is contained in:
Time-Green
2023-07-30 23:58:19 -07:00
committed by GitHub
parent 456ccb2560
commit a695a79f01
3 changed files with 6 additions and 2 deletions
+1 -1
View File
@@ -17,7 +17,7 @@
C.parallax_layers_cached += new /atom/movable/screen/parallax_layer/layer_2(null, src)
C.parallax_layers_cached += new /atom/movable/screen/parallax_layer/planet(null, src)
if(SSparallax.random_layer)
C.parallax_layers_cached += new SSparallax.random_layer.type(null, src, SSparallax.random_layer)
C.parallax_layers_cached += new SSparallax.random_layer.type(null, src, FALSE, SSparallax.random_layer)
C.parallax_layers_cached += new /atom/movable/screen/parallax_layer/layer_3(null, src)
C.parallax_layers = C.parallax_layers_cached.Copy()
+4
View File
@@ -93,4 +93,8 @@ SUBSYSTEM_DEF(parallax)
random_layer = null
/// Called at the end of SSstation setup, in-case we want to run some code that would otherwise be too early to run (like GLOB. stuff)
/datum/controller/subsystem/parallax/proc/post_station_setup()
random_layer?.apply_global_effects()
#undef PARALLAX_NONE
@@ -21,7 +21,7 @@ PROCESSING_SUBSYSTEM_DEF(station)
#endif
announcer = new announcer() //Initialize the station's announcer datum
SSparallax.random_layer.apply_global_effects() //Apply station effects that parallax might have
SSparallax.post_station_setup() //Apply station effects that parallax might have
return SS_INIT_SUCCESS