diff --git a/code/controllers/subsystem/atoms.dm b/code/controllers/subsystem/atoms.dm index ff4641a66cf..13a6befbd04 100644 --- a/code/controllers/subsystem/atoms.dm +++ b/code/controllers/subsystem/atoms.dm @@ -178,6 +178,10 @@ SUBSYSTEM_DEF(atoms) if(!initialized_changed) initialized = old_initialized +/// Returns TRUE if anything is currently being initialized +/datum/controller/subsystem/atoms/proc/initializing_something() + return initialized_changed > 0 + /datum/controller/subsystem/atoms/Recover() initialized = SSatoms.initialized if(initialized == INITIALIZATION_INNEW_MAPLOAD) diff --git a/code/controllers/subsystem/icon_smooth.dm b/code/controllers/subsystem/icon_smooth.dm index d3de5a1b4ac..4d5f3069eca 100644 --- a/code/controllers/subsystem/icon_smooth.dm +++ b/code/controllers/subsystem/icon_smooth.dm @@ -11,6 +11,13 @@ SUBSYSTEM_DEF(icon_smooth) var/list/deferred = list() /datum/controller/subsystem/icon_smooth/fire() + // We do not want to smooth icons of atoms whose neighbors are not initialized yet, + // this causes runtimes. + // Icon smoothing SS runs after atoms, so this only happens for something like shuttles. + // This kind of map loading shouldn't take too long, so the delay is not a problem. + if (SSatoms.initializing_something()) + return + var/list/smooth_queue_cache = smooth_queue while(length(smooth_queue_cache)) var/atom/smoothing_atom = smooth_queue_cache[length(smooth_queue_cache)]