diff --git a/code/__defines/subsystem-priority.dm b/code/__defines/subsystem-priority.dm index 8b5ea99a121..fb9a484227f 100644 --- a/code/__defines/subsystem-priority.dm +++ b/code/__defines/subsystem-priority.dm @@ -25,9 +25,9 @@ #define SS_INIT_SUNLIGHT 1 // Sunlight setup. Creates lots of lighting & SSzcopy updates. #define SS_INIT_LIGHTING 0 // Generation of lighting overlays and pre-bake. May cause openturf updates, should initialize before SSzcopy. #define SS_INIT_ZCOPY -1 // Z-mimic flush. Should run after SSoverlay & SSicon_smooth so it copies the smoothed sprites. -#define SS_INIT_LOBBY -2 // Lobby timer starts here. The lobby timer won't actually start going down until the MC starts ticking, so you probably want this last -#define SS_INIT_CHAT -3 // To ensure chat remains smooth during init. -#define SS_INIT_XENOARCH -4 // Xenoarch is this far below because it can infinite loop if placed in SS_INIT_MISC as it was before, due to some subsystems spawning stuff there. +#define SS_INIT_XENOARCH -2 // Xenoarch is this far below because it can infinite loop if placed in SS_INIT_MISC as it was before, due to some subsystems spawning stuff there. +#define SS_INIT_LOBBY -3 // Lobby timer starts here. The lobby timer won't actually start going down until the MC starts ticking, so you probably want this last +#define SS_INIT_CHAT -4 // To ensure chat remains smooth during init. // Something to remember when setting priorities: SS_TICKER runs before Normal, which runs before SS_BACKGROUND. // Each group has its own priority bracket. diff --git a/code/controllers/subsystems/lighting.dm b/code/controllers/subsystems/lighting.dm index 95f2deec4b5..d894353533c 100644 --- a/code/controllers/subsystems/lighting.dm +++ b/code/controllers/subsystems/lighting.dm @@ -76,6 +76,11 @@ var/datum/controller/subsystem/lighting/SSlighting for (var/zlevel = 1 to world.maxz) for (thing in Z_ALL_TURFS(zlevel)) T = thing + if(config.starlight) + var/turf/space/S = T + if(istype(S) && S.use_starlight) + S.update_starlight() + if (!T.dynamic_lighting) continue diff --git a/code/datums/ruins.dm b/code/datums/ruins.dm index c9d521c9423..d279468f55d 100644 --- a/code/datums/ruins.dm +++ b/code/datums/ruins.dm @@ -12,7 +12,7 @@ var/prefix = null var/suffix = null - template_flags = 0 // No duplicates by default + template_flags = TEMPLATE_FLAG_NO_RUINS // Don't let ruins spawn on top of ruins // !! Currently only implemented for away sites var/list/force_ruins // Listed ruins are always spawned unless disallowed by flags. diff --git a/code/game/turfs/space/space.dm b/code/game/turfs/space/space.dm index f48e7791ddb..576d40ff7e6 100644 --- a/code/game/turfs/space/space.dm +++ b/code/game/turfs/space/space.dm @@ -25,7 +25,7 @@ /turf/space/Initialize() if(use_space_appearance) appearance = SSskybox.space_appearance_cache[(((x + y) ^ ~(x * y) + z) % 25) + 1] - if(config.starlight && use_starlight) + if(config.starlight && use_starlight && lighting_overlays_initialized) update_starlight() if (initialized) @@ -62,12 +62,10 @@ return 0 -/turf/space/proc/update_starlight(var/validate = TRUE) +/turf/space/proc/update_starlight() if(!config.starlight) return - if(!validate) // basically a hack for places where the check was already done for us - set_light(1, config.starlight, l_color = SSskybox.background_color) - else if(locate(/turf/simulated) in RANGE_TURFS(1, src)) + if(locate(/turf/simulated) in RANGE_TURFS(1, src)) set_light(1, config.starlight, l_color = SSskybox.background_color) else set_light(0) diff --git a/code/game/turfs/turf_changing.dm b/code/game/turfs/turf_changing.dm index 49cb5eee16d..668eab2793c 100644 --- a/code/game/turfs/turf_changing.dm +++ b/code/game/turfs/turf_changing.dm @@ -83,9 +83,9 @@ else lighting_clear_overlay() - if (config.starlight) - for (var/turf/space/S in RANGE_TURFS(1, src)) - S.update_starlight(FALSE) + if (config.starlight) + for (var/turf/space/S in RANGE_TURFS(1, src)) + S.update_starlight() W.above = old_above diff --git a/code/modules/random_map/random_map.dm b/code/modules/random_map/random_map.dm index bb769caed00..b4a7effd854 100644 --- a/code/modules/random_map/random_map.dm +++ b/code/modules/random_map/random_map.dm @@ -50,7 +50,7 @@ var/global/list/map_count = list() if(tlx) limit_x = tlx if(tly) limit_y = tly - if(used_area) + if(!use_area && used_area) if(ispath(used_area)) use_area = new(used_area) else @@ -186,7 +186,7 @@ var/global/list/map_count = list() if(!T || (target_turf_type && !istype(T,target_turf_type))) return 0 var/newpath = get_appropriate_path(map[tmp_cell]) - if(newpath) + if(newpath && !istype(T, newpath)) T.ChangeTurf(newpath) if(spawn_roof) T.spawn_roof() diff --git a/html/changelogs/johnwildkins-fixlag2.yml b/html/changelogs/johnwildkins-fixlag2.yml new file mode 100644 index 00000000000..606fb5f1d8b --- /dev/null +++ b/html/changelogs/johnwildkins-fixlag2.yml @@ -0,0 +1,9 @@ +author: JohnWildkins + +delete-after: True + +changes: + - bugfix: "Ruins should no longer generate on top of each other." + - backend: "Starlight generation is now handled in SSlighting, so temporary space tiles are not calculated." + - backend: "Fixed an issue where exoplanets were creating 2x as many necessary space tiles during generation." + - backend: "Moved SSxenoarch init above SSlobby." diff --git a/maps/sccv_horizon/code/sccv_horizon.dm b/maps/sccv_horizon/code/sccv_horizon.dm index be1d2d6ccce..0bd3ebc332d 100644 --- a/maps/sccv_horizon/code/sccv_horizon.dm +++ b/maps/sccv_horizon/code/sccv_horizon.dm @@ -126,7 +126,3 @@ allow_borgs_to_leave = TRUE warehouse_basearea = /area/operations/storage - -/datum/map/sccv_horizon/finalize_load() - // generate an empty space Z - world.maxz++