Skip to content

Commit

Permalink
Merge pull request #489 from NataKilar/exterior-stopgap-fix
Browse files Browse the repository at this point in the history
Stopgap exterior turf load fix
  • Loading branch information
Andrew-Fall authored Jan 11, 2024
2 parents 7f2ece5 + fecca8e commit a48b6bd
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions mods/persistence/_persistence.dme
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "controllers\atoms.dm"
#include "controllers\autotransfer.dm"
#include "controllers\ticker.dm"
#include "controllers\subsystems\air.dm"
#include "controllers\subsystems\autosave.dm"
#include "controllers\subsystems\mapping.dm"
#include "controllers\subsystems\mining.dm"
Expand Down
14 changes: 14 additions & 0 deletions mods/persistence/controllers/subsystems/air.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// TODO: Solve this issue properly
// On load, we check turfs which have been marked for update and cull any which are outside. What's likely happening is they're being marked for update before
// all z-levels are initialized, but it will take some time to track this down
/datum/controller/subsystem/air/proc/cull_updated_turfs()

var/list/new_tiles_to_update = list()

var/list/curr_tiles = tiles_to_update
for(var/turf/T as anything in curr_tiles)
if(SHOULD_PARTICIPATE_IN_ZONES(T))
new_tiles_to_update += T

tiles_to_update.Cut()
tiles_to_update = new_tiles_to_update
3 changes: 3 additions & 0 deletions mods/persistence/controllers/subsystems/mapping.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
PRINT_STACK_TRACE("Missing z-level data object for loaded z[num2text(z)]!")
level.setup_level_data(TRUE)
report_progress_serializer("Finished setting up level data for loaded z-levels!")

// Stopgap fix. We do this here rather than in SSair.Initialize because SSair may be rebooted.
SSair.cull_updated_turfs()
else
report_progress_serializer("No existing save found. Loading from map files..")
#else
Expand Down

0 comments on commit a48b6bd

Please sign in to comment.