diff --git a/code/__defines/subsystem-defines.dm b/code/__defines/subsystem-defines.dm
index 2377bba85d2..6d836b08675 100644
--- a/code/__defines/subsystem-defines.dm
+++ b/code/__defines/subsystem-defines.dm
@@ -43,21 +43,27 @@
// -- SSatoms stuff --
// Technically this check will fail if someone loads a map mid-round, but that's not enabled right now.
+
+///TRUE if the INITIAL SSatoms initialization has finished, aka the atoms are initialized and mapload has finished
#define SSATOMS_IS_PROBABLY_DONE (SSatoms.initialized == INITIALIZATION_INNEW_REGULAR)
//type and all subtypes should always call Initialize in New()
#define INITIALIZE_IMMEDIATE(X) ##X/New(loc, ...){\
- ..();\
- if(!initialized) {\
- args[1] = TRUE;\
- SSatoms.InitAtom(src, args);\
- }\
+ ..();\
+ if(!initialized) {\
+ args[1] = TRUE;\
+ SSatoms.InitAtom(src, args);\
+ }\
}
-// SSatoms Initialization state.
-#define INITIALIZATION_INSSATOMS 0 //New should not call Initialize
-#define INITIALIZATION_INNEW_MAPLOAD 1 //New should call Initialize(TRUE)
-#define INITIALIZATION_INNEW_REGULAR 2 //New should call Initialize(FALSE)
+/* Initialization subsystem */
+
+///New should not call Initialize
+#define INITIALIZATION_INSSATOMS 0
+///New should call Initialize(TRUE)
+#define INITIALIZATION_INNEW_MAPLOAD 2
+///New should call Initialize(FALSE)
+#define INITIALIZATION_INNEW_REGULAR 1
// Initialize() hints for SSatoms.
#define INITIALIZE_HINT_NORMAL 0 //Nothing happens
diff --git a/code/_helpers/icon_smoothing.dm b/code/_helpers/icon_smoothing.dm
index 4bfe0fb0807..6dbfa27421f 100644
--- a/code/_helpers/icon_smoothing.dm
+++ b/code/_helpers/icon_smoothing.dm
@@ -31,18 +31,41 @@
#define N_SOUTHEAST 64
#define N_SOUTHWEST 1024
-#define SMOOTH_FALSE 0 // not smooth
-#define SMOOTH_TRUE 1 // smooths with exact specified types or just itself
-#define SMOOTH_MORE 2 // smooths with all subtypes of specified types or just itself (this value can replace SMOOTH_TRUE)
-#define SMOOTH_DIAGONAL 4 // if atom should smooth diagonally, this should be present in 'smooth' var
-#define SMOOTH_BORDER 8 // atom will smooth with the borders of the map
-#define SMOOTH_QUEUED 16 // atom is currently queued to smooth.
-#define SMOOTH_NO_CLEAR_ICON 32 // don't clear the atom's icon_state on smooth.
-#define SMOOTH_UNDERLAYS 64 // Add underlays, detached from diagonal smoothing.
+/* smoothing_flags */
+
+///Do not smooth
+#define SMOOTH_FALSE BITFLAG(0)
+
+///Smooths with exact specified types or just itself
+#define SMOOTH_TRUE BITFLAG(1)
+
+///Smooths with all subtypes of specified types or just itself (this value can replace SMOOTH_TRUE)
+#define SMOOTH_MORE BITFLAG(2)
+
+///If atom should smooth diagonally, this should be present in 'smooth' var
+#define SMOOTH_DIAGONAL BITFLAG(3)
+
+///Atom will smooth with the borders of the map
+#define SMOOTH_BORDER BITFLAG(4)
+
+///Atom is currently queued to smooth.
+#define SMOOTH_QUEUED BITFLAG(5)
+
+///Don't clear the atom's icon_state on smooth.
+#define SMOOTH_NO_CLEAR_ICON BITFLAG(6)
+
+///Add underlays, detached from diagonal smoothing.
+#define SMOOTH_UNDERLAYS BITFLAG(7)
+
+/* smoothing_hints */
+
+///Don't draw the 'F' state. Useful with SMOOTH_NO_CLEAR_ICON.
+#define SMOOTHHINT_CUT_F 1
+///Only try to match turfs (this is faster than matching all atoms)
+#define SMOOTHHINT_ONLY_MATCH_TURF 2
+///The smoother can assume that all atoms of this type will have the same canSmoothWith value.
+#define SMOOTHHINT_TARGETS_NOT_UNIQUE 4
-#define SMOOTHHINT_CUT_F 1 // Don't draw the 'F' state. Useful with SMOOTH_NO_CLEAR_ICON.
-#define SMOOTHHINT_ONLY_MATCH_TURF 2 // Only try to match turfs (this is faster than matching all atoms)
-#define SMOOTHHINT_TARGETS_NOT_UNIQUE 4 // The smoother can assume that all atoms of this type will have the same canSmoothWith value.
#define NULLTURF_BORDER 123456789
@@ -51,7 +74,7 @@
#define DEFAULT_UNDERLAY_IMAGE image(DEFAULT_UNDERLAY_ICON, DEFAULT_UNDERLAY_ICON_STATE)
/atom
- var/smooth = SMOOTH_FALSE
+ var/smoothing_flags = SMOOTH_FALSE
var/smoothing_hints = SMOOTHHINT_TARGETS_NOT_UNIQUE
var/tmp/top_left_corner
var/tmp/top_right_corner
@@ -96,12 +119,12 @@
if (smoothing_hints & SMOOTHHINT_TARGETS_NOT_UNIQUE)
tcache = SSicon_smooth.typecachecache[type]
if (!tcache)
- tcache = typecacheof(canSmoothWith || type, FALSE, !(smooth & SMOOTH_MORE))
+ tcache = typecacheof(canSmoothWith || type, FALSE, !(smoothing_flags & SMOOTH_MORE))
SSicon_smooth.typecachecache[type] = tcache
else
- tcache = typecacheof(canSmoothWith || type, FALSE, !(smooth & SMOOTH_MORE))
+ tcache = typecacheof(canSmoothWith || type, FALSE, !(smoothing_flags & SMOOTH_MORE))
- if (smooth & SMOOTH_BORDER)
+ if (smoothing_flags & SMOOTH_BORDER)
CALCULATE_NEIGHBORS(src, adjacencies, T, !T || tcache[T.type])
else
CALCULATE_NEIGHBORS(src, adjacencies, T, T && tcache[T.type])
@@ -111,7 +134,7 @@
for(var/direction in cardinal)
AM = find_type_in_direction(src, direction)
if(AM == NULLTURF_BORDER)
- if((smooth & SMOOTH_BORDER))
+ if((smoothing_flags & SMOOTH_BORDER))
adjacencies |= 1 << direction
else if( (AM && !istype(AM)) || (istype(AM) && AM.anchored) )
adjacencies |= 1 << direction
@@ -120,14 +143,14 @@
if(adjacencies & N_WEST)
AM = find_type_in_direction(src, NORTHWEST)
if(AM == NULLTURF_BORDER)
- if((smooth & SMOOTH_BORDER))
+ if((smoothing_flags & SMOOTH_BORDER))
adjacencies |= N_NORTHWEST
else if( (AM && !istype(AM)) || (istype(AM) && AM.anchored) )
adjacencies |= N_NORTHWEST
if(adjacencies & N_EAST)
AM = find_type_in_direction(src, NORTHEAST)
if(AM == NULLTURF_BORDER)
- if((smooth & SMOOTH_BORDER))
+ if((smoothing_flags & SMOOTH_BORDER))
adjacencies |= N_NORTHEAST
else if( (AM && !istype(AM)) || (istype(AM) && AM.anchored) )
adjacencies |= N_NORTHEAST
@@ -136,14 +159,14 @@
if(adjacencies & N_WEST)
AM = find_type_in_direction(src, SOUTHWEST)
if(AM == NULLTURF_BORDER)
- if((smooth & SMOOTH_BORDER))
+ if((smoothing_flags & SMOOTH_BORDER))
adjacencies |= N_SOUTHWEST
else if( (AM && !istype(AM)) || (istype(AM) && AM.anchored) )
adjacencies |= N_SOUTHWEST
if(adjacencies & N_EAST)
AM = find_type_in_direction(src, SOUTHEAST)
if(AM == NULLTURF_BORDER)
- if((smooth & SMOOTH_BORDER))
+ if((smoothing_flags & SMOOTH_BORDER))
adjacencies |= N_SOUTHEAST
else if( (AM && !istype(AM)) || (istype(AM) && AM.anchored) )
adjacencies |= N_SOUTHEAST
@@ -156,25 +179,28 @@
return ..()
-//do not use, use queue_smooth(atom)
+///Do not use, use SSicon_smooth.add_to_queue(atom)
/proc/smooth_icon(atom/A)
- if(!A || !A.smooth)
+ SHOULD_NOT_SLEEP(TRUE)
+ if(!A || !A.smoothing_flags)
return
- A.smooth &= ~SMOOTH_QUEUED
+ A.smoothing_flags &= ~SMOOTH_QUEUED
if (!A.z)
return
if(QDELETED(A))
return
A.flags |= HTML_USE_INITAL_ICON
- if((A.smooth & SMOOTH_TRUE) || (A.smooth & SMOOTH_MORE))
+ if((A.smoothing_flags & SMOOTH_TRUE) || (A.smoothing_flags & SMOOTH_MORE))
var/adjacencies = A.calculate_adjacencies()
- if(A.smooth & SMOOTH_DIAGONAL)
+ if(A.smoothing_flags & SMOOTH_DIAGONAL)
A.diagonal_smooth(adjacencies)
else
A.cardinal_smooth(adjacencies)
/atom/proc/diagonal_smooth(adjacencies)
+ SHOULD_NOT_SLEEP(TRUE)
+
switch(adjacencies)
if(N_NORTH|N_WEST)
replace_smooth_overlays("d-se","d-se-0")
@@ -239,6 +265,8 @@
underlays = U
/turf/proc/get_underlays(var/list/adjacencies)
+ SHOULD_NOT_SLEEP(TRUE)
+
//First of all, check if there are turfs like us we can ask for underlays.
adjacencies = calculate_adjacencies()
var/success = FALSE
@@ -262,8 +290,10 @@
underlays = U
-//Blend atoms
+//Blend atoms
/atom/proc/handle_blending(adjacencies, var/list/dir_mods, var/overlay_layer = 3)
+ SHOULD_NOT_SLEEP(TRUE)
+
LAZYINITLIST(dir_mods)
var/walls_found = 0 //Bitfield of the directions of walls we've found.
for(var/adjacency in list(N_NORTH, N_EAST, N_SOUTH, N_WEST))
@@ -298,6 +328,8 @@
return "w"
/atom/proc/cardinal_smooth(adjacencies, var/list/dir_mods)
+ SHOULD_NOT_SLEEP(TRUE)
+
//NW CORNER
var/nw = "1-i"
if((adjacencies & N_NORTH) && (adjacencies & N_WEST))
@@ -388,12 +420,14 @@
if(New)
add_overlay(New)
- if (icon_state && !(smooth & SMOOTH_NO_CLEAR_ICON))
+ if (icon_state && !(smoothing_flags & SMOOTH_NO_CLEAR_ICON))
icon_state = null
// A more stripped down version of the above, meant for using images to apply multiple smooth overlays
// at once.
/proc/cardinal_smooth_fromicon(icon/I, adjacencies)
+ SHOULD_NOT_SLEEP(TRUE)
+
//NW CORNER
var/nw = "1-i"
if((adjacencies & N_NORTH) && (adjacencies & N_WEST))
@@ -461,7 +495,7 @@
if (source.smoothing_hints & SMOOTHHINT_TARGETS_NOT_UNIQUE)
var/list/tcache = SSicon_smooth.typecachecache[source.type]
if (!tcache)
- tcache = typecacheof(source.canSmoothWith || source.type, FALSE, !(source.smooth & SMOOTH_MORE))
+ tcache = typecacheof(source.canSmoothWith || source.type, FALSE, !(source.smoothing_flags & SMOOTH_MORE))
SSicon_smooth.typecachecache[source.type] = tcache
if (is_type_in_typecache(target_turf, tcache))
@@ -470,7 +504,7 @@
else
if(source.canSmoothWith)
var/atom/A
- if(source.smooth & SMOOTH_MORE)
+ if(source.smoothing_flags & SMOOTH_MORE)
for(var/a_type in source.canSmoothWith)
if( istype(target_turf, a_type) )
return target_turf
@@ -498,22 +532,26 @@
//Icon smoothing helpers
/proc/smooth_zlevel(var/zlevel, now = FALSE)
+ SHOULD_NOT_SLEEP(TRUE)
+
for(var/V in Z_ALL_TURFS(zlevel))
var/turf/T = V
- if(T.smooth)
+ if(T.smoothing_flags)
if(now)
smooth_icon(T)
else
- queue_smooth(T)
+ SSicon_smooth.add_to_queue(T)
for(var/R in T)
var/atom/A = R
- if(A.smooth)
+ if(A.smoothing_flags)
if(now)
smooth_icon(A)
else
- queue_smooth(A)
+ SSicon_smooth.add_to_queue(A)
/atom/proc/clear_smooth_overlays()
+ SHOULD_NOT_SLEEP(TRUE)
+
cut_overlay(list(top_left_corner, top_right_corner, bottom_left_corner, bottom_right_corner))
top_left_corner = null
top_right_corner = null
@@ -521,6 +559,8 @@
bottom_left_corner = null
/atom/proc/replace_smooth_overlays(nw, ne, sw, se)
+ SHOULD_NOT_SLEEP(TRUE)
+
clear_smooth_overlays()
var/list/O = list()
top_left_corner = nw
@@ -534,6 +574,9 @@
add_overlay(O)
/proc/reverse_ndir(ndir)
+ SHOULD_NOT_SLEEP(TRUE)
+ SHOULD_BE_PURE(TRUE)
+
switch(ndir)
if(N_NORTH)
return NORTH
@@ -569,18 +612,3 @@
return SOUTHEAST
else
return 0
-
-//SSicon_smooth
-/proc/queue_smooth_neighbors(atom/A)
- for(var/atom/T as anything in orange(1,A))
- if(T.smooth)
- queue_smooth(T)
-
-//SSicon_smooth
-/proc/queue_smooth(atom/A)
- if(!A.smooth || A.smooth & SMOOTH_QUEUED)
- return
-
- SSicon_smooth.smooth_queue += A
- SSicon_smooth.wake()
- A.smooth |= SMOOTH_QUEUED
diff --git a/code/controllers/subsystems/icon_smooth.dm b/code/controllers/subsystems/icon_smooth.dm
index 57f4a52deb8..0dd92d983f4 100644
--- a/code/controllers/subsystems/icon_smooth.dm
+++ b/code/controllers/subsystems/icon_smooth.dm
@@ -1,3 +1,20 @@
+/**
+ * Adds an atom to the smoothing queue
+ *
+ * Used only internally to save on proc calls, eg. for `add_to_queue_neighbors`
+ *
+ * * thing - An `/atom` to add to the queue
+ */
+#define SSICONSMOOTH_ADD_TO_QUEUE(thing) \
+ if(thing.smoothing_flags & SMOOTH_QUEUED){ \
+ return; \
+ }\
+ thing.smoothing_flags |= SMOOTH_QUEUED; \
+ smooth_queue += thing; \
+ if(!can_fire){ \
+ can_fire = TRUE; \
+ }
+
var/datum/controller/subsystem/icon_smooth/SSicon_smooth
/datum/controller/subsystem/icon_smooth
@@ -24,17 +41,27 @@ var/datum/controller/subsystem/icon_smooth/SSicon_smooth
return ..()
/datum/controller/subsystem/icon_smooth/fire()
+ if(SSatoms.initializing_something())
+ return
+
if (explosion_in_progress)
return
- while(smooth_queue.len)
- var/atom/A = smooth_queue[smooth_queue.len]
- smooth_queue.len--
- smooth_icon(A)
+ var/list/smooth_queue_cache = smooth_queue
+ while(length(smooth_queue_cache))
+ var/atom/smoothing_atom = smooth_queue_cache[length(smooth_queue_cache)]
+ smooth_queue_cache.len--
+
+ if(QDELETED(smoothing_atom) || !(smoothing_atom.smoothing_flags & SMOOTH_QUEUED))
+ continue
+
+ smooth_icon(smoothing_atom)
+
if (MC_TICK_CHECK)
return
- if (!smooth_queue.len)
- suspend()
+
+ if (!length(smooth_queue_cache))
+ can_fire = FALSE
/datum/controller/subsystem/icon_smooth/ExplosionStart()
explosion_in_progress = TRUE
@@ -48,16 +75,46 @@ var/datum/controller/subsystem/icon_smooth/SSicon_smooth
if (config.fastboot)
LOG_DEBUG("icon_smoothing: Skipping prebake, fastboot enabled.")
- ..()
- return
+ return ..()
- var/queue = smooth_queue
+ var/list/queue = smooth_queue
smooth_queue = list()
- for(var/V in queue)
- var/atom/A = V
- if(!A)
+
+ while(length(queue))
+ var/atom/smoothing_atom = queue[length(queue)]
+ queue.len--
+
+ if(QDELETED(smoothing_atom) || !(smoothing_atom.smoothing_flags & SMOOTH_QUEUED) || !smoothing_atom.z)
continue
- smooth_icon(A)
+
+ smooth_icon(smoothing_atom)
+
CHECK_TICK
- ..()
+ . = ..()
+
+/datum/controller/subsystem/icon_smooth/proc/add_to_queue(atom/thing)
+ SHOULD_NOT_SLEEP(TRUE)
+
+ if(thing.smoothing_flags & SMOOTH_QUEUED)
+ return
+ thing.smoothing_flags |= SMOOTH_QUEUED
+ smooth_queue += thing
+
+ if(!can_fire)
+ can_fire = TRUE
+
+/datum/controller/subsystem/icon_smooth/proc/add_to_queue_neighbors(atom/thing)
+ SHOULD_NOT_SLEEP(TRUE)
+
+ for(var/atom/neighbor as anything in orange(1,thing))
+ if(neighbor.smoothing_flags)
+ SSICONSMOOTH_ADD_TO_QUEUE(neighbor)
+
+/datum/controller/subsystem/icon_smooth/proc/remove_from_queues(atom/thing)
+ SHOULD_NOT_SLEEP(TRUE)
+
+ thing.smoothing_flags &= ~SMOOTH_QUEUED
+ smooth_queue -= thing
+
+#undef SSICONSMOOTH_ADD_TO_QUEUE
diff --git a/code/controllers/subsystems/initialization/atoms.dm b/code/controllers/subsystems/initialization/atoms.dm
index e8546bc0b08..f300619aa8d 100644
--- a/code/controllers/subsystems/initialization/atoms.dm
+++ b/code/controllers/subsystems/initialization/atoms.dm
@@ -1,3 +1,5 @@
+#define SUBSYSTEM_INIT_SOURCE "subsystem init"
+
var/datum/controller/subsystem/atoms/SSatoms
#define BAD_INIT_QDEL_BEFORE 1
@@ -10,6 +12,11 @@ var/datum/controller/subsystem/atoms/SSatoms
init_order = SS_INIT_ATOMS
flags = SS_NO_FIRE
+ /// A stack of list(source, desired initialized state)
+ /// We read the source of init changes from the last entry, and assert that all changes will come with a reset
+ var/list/initialized_state = list()
+ var/base_initialized
+
var/initialized = INITIALIZATION_INSSATOMS
var/old_initialized
@@ -27,13 +34,14 @@ var/datum/controller/subsystem/atoms/SSatoms
/datum/controller/subsystem/atoms/Initialize(timeofday)
initialized = INITIALIZATION_INNEW_MAPLOAD
InitializeAtoms()
+ initialized = INITIALIZATION_INNEW_REGULAR
return ..()
/datum/controller/subsystem/atoms/proc/InitializeAtoms(list/atoms)
if(initialized == INITIALIZATION_INSSATOMS)
return
- initialized = INITIALIZATION_INNEW_MAPLOAD
+ set_tracked_initalized(INITIALIZATION_INNEW_MAPLOAD, SUBSYSTEM_INIT_SOURCE)
LAZYINITLIST(late_loaders)
LAZYINITLIST(late_qdel)
@@ -58,7 +66,7 @@ var/datum/controller/subsystem/atoms/SSatoms
admin_notice(SPAN_DANGER("Initialized [count] atoms."), R_DEBUG)
log_subsystem("atoms", "Initialized [count] atoms.")
- initialized = INITIALIZATION_INNEW_REGULAR
+ clear_tracked_initalize(SUBSYSTEM_INIT_SOURCE)
if(late_loaders.len)
for(var/I in 1 to late_loaders.len)
@@ -127,12 +135,17 @@ var/datum/controller/subsystem/atoms/SSatoms
/datum/controller/subsystem/atoms/proc/ForceInitializeContents(atom/A)
var/list/mload_args = list(TRUE)
var/loaded = 0
+
+ set_tracked_initalized(INITIALIZATION_INNEW_MAPLOAD, SUBSYSTEM_INIT_SOURCE+"- ForceInitializeContents: [text_ref(A)]")
+
for (var/thing in A)
var/atom/movable/AM = thing
if (!AM.initialized)
InitAtom(AM, mload_args)
++loaded
+ clear_tracked_initalize(SUBSYSTEM_INIT_SOURCE+"- ForceInitializeContents: [text_ref(A)]")
+
LOG_DEBUG("atoms: force-loaded [loaded] out of [A.contents.len] atoms in [A].")
/datum/controller/subsystem/atoms/proc/InitLog()
@@ -158,11 +171,39 @@ var/datum/controller/subsystem/atoms/SSatoms
initialized = SSatoms.initialized
if(initialized == INITIALIZATION_INNEW_MAPLOAD)
InitializeAtoms()
- old_initialized = SSatoms.old_initialized
+ initialized_state = SSatoms.initialized_state
+ BadInitializeCalls = SSatoms.BadInitializeCalls
-/datum/controller/subsystem/atoms/proc/map_loader_begin()
- old_initialized = initialized
- initialized = INITIALIZATION_INSSATOMS
+/datum/controller/subsystem/atoms/proc/map_loader_begin(source)
+ set_tracked_initalized(INITIALIZATION_INSSATOMS, source)
-/datum/controller/subsystem/atoms/proc/map_loader_stop()
- initialized = old_initialized
+/datum/controller/subsystem/atoms/proc/map_loader_stop(source)
+ clear_tracked_initalize(source)
+
+/// Use this to set initialized to prevent error states where the old initialized is overriden, and we end up losing all context
+/// Accepts a state and a source, the most recent state is used, sources exist to prevent overriding old values accidentially
+/datum/controller/subsystem/atoms/proc/set_tracked_initalized(state, source)
+ if(!length(initialized_state))
+ base_initialized = initialized
+ initialized_state += list(list(source, state))
+ initialized = state
+
+/datum/controller/subsystem/atoms/proc/clear_tracked_initalize(source)
+ if(!length(initialized_state))
+ return
+ for(var/i in length(initialized_state) to 1 step -1)
+ if(initialized_state[i][1] == source)
+ initialized_state.Cut(i, i+1)
+ break
+
+ if(!length(initialized_state))
+ initialized = base_initialized
+ base_initialized = INITIALIZATION_INNEW_REGULAR
+ return
+ initialized = initialized_state[length(initialized_state)][2]
+
+/// Returns TRUE if anything is currently being initialized
+/datum/controller/subsystem/atoms/proc/initializing_something()
+ return length(initialized_state) > 1
+
+#undef SUBSYSTEM_INIT_SOURCE
diff --git a/code/game/atoms_init.dm b/code/game/atoms_init.dm
index 2cac8996f5d..da4e63ffb2d 100644
--- a/code/game/atoms_init.dm
+++ b/code/game/atoms_init.dm
@@ -52,9 +52,23 @@
return INITIALIZE_HINT_NORMAL
-//called if Initialize returns INITIALIZE_HINT_LATELOAD
-//This version shouldn't be called
+/**
+ * Late Intialization, for code that should run after all atoms have run Intialization
+ *
+ * To have your LateIntialize proc be called, your atoms [Initalization][/atom/proc/Initialize]
+ * proc must return the hint
+ * [INITIALIZE_HINT_LATELOAD] otherwise it will never be called.
+ *
+ * useful for doing things like finding other machines because you can guarantee
+ * that all atoms will actually exist in the "WORLD" at this time and that all their Intialization
+ * code has been run
+ */
/atom/proc/LateInitialize()
+ set waitfor = FALSE
+
+ //You can override this in your inheritance if you *really* need to, but probably shouldn't
+ SHOULD_NOT_SLEEP(TRUE)
+
var/static/list/warned_types = list()
if(!warned_types[type])
WARNING("Old style LateInitialize behaviour detected in [type]!")
diff --git a/code/game/objects/items/airbubble.dm b/code/game/objects/items/airbubble.dm
index 57e2c26d475..2b1d9fad733 100644
--- a/code/game/objects/items/airbubble.dm
+++ b/code/game/objects/items/airbubble.dm
@@ -135,8 +135,8 @@
qdel(internal_tank)
if(parts)
new parts(loc)
- if (smooth)
- queue_smooth_neighbors(src)
+ if (smoothing_flags)
+ SSicon_smooth.add_to_queue_neighbors(src)
return ..()
/obj/structure/closet/airbubble/toggle(mob/user as mob)
diff --git a/code/game/objects/items/draftingchalk.dm b/code/game/objects/items/draftingchalk.dm
index a17e5372edb..39a8116cb85 100644
--- a/code/game/objects/items/draftingchalk.dm
+++ b/code/game/objects/items/draftingchalk.dm
@@ -6,12 +6,12 @@
color = "#FFFFFF"
layer = 2.1
anchored = TRUE
- smooth = SMOOTH_TRUE
+ smoothing_flags = SMOOTH_TRUE
/obj/effect/decal/cleanable/draftingchalk/Initialize(mapload)
. = ..()
if (mapload)
- queue_smooth(src)
+ SSicon_smooth.add_to_queue(src)
else
smooth_icon(src)
for (var/obj/effect/decal/cleanable/draftingchalk/C in orange(1, src))
diff --git a/code/game/objects/structures.dm b/code/game/objects/structures.dm
index 7d8a149cd79..620671e8ef1 100644
--- a/code/game/objects/structures.dm
+++ b/code/game/objects/structures.dm
@@ -18,8 +18,8 @@
/obj/structure/Destroy()
if(parts)
new parts(loc)
- if (smooth)
- queue_smooth_neighbors(src)
+ if (smoothing_flags)
+ SSicon_smooth.add_to_queue_neighbors(src)
return ..()
/obj/structure/attack_hand(mob/user)
@@ -73,9 +73,9 @@
updateVisibility(src) // No point checking this before visualnet initializes.
if(climbable)
verbs += /obj/structure/proc/climb_on
- if (smooth)
- queue_smooth(src)
- queue_smooth_neighbors(src)
+ if (smoothing_flags)
+ SSicon_smooth.add_to_queue(src)
+ SSicon_smooth.add_to_queue_neighbors(src)
/obj/structure/proc/climb_on()
diff --git a/code/game/objects/structures/full_window_frame.dm b/code/game/objects/structures/full_window_frame.dm
index d02758fcb20..2fde8584026 100644
--- a/code/game/objects/structures/full_window_frame.dm
+++ b/code/game/objects/structures/full_window_frame.dm
@@ -9,7 +9,7 @@
anchored = TRUE
density = TRUE
climbable = TRUE
- smooth = SMOOTH_MORE
+ smoothing_flags = SMOOTH_MORE
breakable = TRUE
can_be_unanchored = TRUE
canSmoothWith = list(
@@ -153,7 +153,7 @@
/obj/structure/window_frame/shuttle
icon = 'icons/obj/smooth/window/full_window_frame_color.dmi'
color = null
- smooth = SMOOTH_MORE
+ smoothing_flags = SMOOTH_MORE
canSmoothWith = list(
/turf/simulated/wall/shuttle,
/turf/simulated/wall/shuttle/cardinal,
diff --git a/code/game/objects/structures/grille.dm b/code/game/objects/structures/grille.dm
index 72e2555cfd1..dc6a6268bb1 100644
--- a/code/game/objects/structures/grille.dm
+++ b/code/game/objects/structures/grille.dm
@@ -19,7 +19,7 @@
name = "over-frame grille"
icon = 'icons/obj/smooth/window/grille_over.dmi'
layer = BELOW_OBJ_LAYER
- smooth = SMOOTH_MORE
+ smoothing_flags = SMOOTH_MORE
canSmoothWith = list(
/turf/simulated/wall,
/turf/simulated/wall/r_wall,
@@ -158,7 +158,7 @@
playsound(loc, 'sound/items/Screwdriver.ogg', 100, 1)
anchored = !anchored
user.visible_message("[user] [anchored ? "fastens" : "unfastens"] the grille.", \
- "You have [anchored ? "fastened the grille to" : "unfastened the grill from"] the floor.")
+ "You have [anchored ? "fastened the grille to" : "unfastened the grill from"] the floor.")
return
else if(istype(W,/obj/item/stack/rods) && destroyed == 1)
if(!shock(user, 90))
@@ -169,7 +169,7 @@
icon_state = "grille"
ROD.use(1)
user.visible_message("[user] repairs the grille.", \
- "You have repaired the grille.")
+ "You have repaired the grille.")
return
//window placing begin //TODO CONVERT PROPERLY TO MATERIAL DATUM
diff --git a/code/game/objects/structures/lattice.dm b/code/game/objects/structures/lattice.dm
index 7fe9b9ed941..7b5289d6bdc 100644
--- a/code/game/objects/structures/lattice.dm
+++ b/code/game/objects/structures/lattice.dm
@@ -10,7 +10,7 @@
w_class = ITEMSIZE_NORMAL
layer = UNDER_PIPE_LAYER //under pipes
obj_flags = OBJ_FLAG_MOVES_UNSUPPORTED
- smooth = SMOOTH_MORE
+ smoothing_flags = SMOOTH_MORE
canSmoothWith = list(
/obj/structure/lattice,
/turf/simulated/wall,
@@ -74,7 +74,7 @@
desc = "A catwalk for easier EVA maneuvering."
icon = 'icons/obj/smooth/catwalk.dmi'
icon_state = "catwalk"
- smooth = SMOOTH_TRUE
+ smoothing_flags = SMOOTH_TRUE
canSmoothWith = list(
/obj/structure/lattice/catwalk,
/obj/structure/lattice/catwalk/indoor
@@ -105,8 +105,8 @@
if(C.use_tool(src, user, 5, volume = 50))
anchored = !anchored
to_chat(user, SPAN_NOTICE("You [anchored ? "" : "un"]anchor [src]."))
- queue_smooth(src)
- queue_smooth_neighbors(src)
+ SSicon_smooth.add_to_queue(src)
+ SSicon_smooth.add_to_queue_neighbors(src)
else
..()
@@ -122,7 +122,7 @@
icon = 'icons/obj/grate.dmi'
icon_state = "grate"
return_amount = 1
- smooth = null
+ smoothing_flags = null
color = COLOR_TILED
var/base_icon_state = "grate"
var/damaged = FALSE
@@ -192,7 +192,7 @@
icon = 'icons/obj/structure/over_turf.dmi'
icon_state = "city_grate"
return_amount = 1
- smooth = null
+ smoothing_flags = null
/obj/structure/lattice/catwalk/indoor/tatami
name = "tatami spread"
@@ -200,7 +200,7 @@
icon = 'icons/obj/structure/over_turf.dmi'
icon_state = "tatami"
return_amount = null
- smooth = null
+ smoothing_flags = null
footstep_sound = /singleton/sound_category/carpet_footstep
/obj/structure/lattice/catwalk/indoor/planks
@@ -209,7 +209,7 @@
icon = 'icons/obj/structure/urban/wood.dmi'
icon_state = "plank"
return_amount = null
- smooth = null
+ smoothing_flags = null
footstep_sound = /singleton/sound_category/wood_footstep
/obj/structure/lattice/catwalk/indoor/planks/opaque
diff --git a/code/game/objects/structures/urban.dm b/code/game/objects/structures/urban.dm
index 6b77a2ec639..f5d940d6e17 100644
--- a/code/game/objects/structures/urban.dm
+++ b/code/game/objects/structures/urban.dm
@@ -496,7 +496,7 @@
icon_state = "frame_half"
//basestate = "frame_half"
color = COLOR_GUNMETAL
- smooth = null
+ smoothing_flags = null
/obj/structure/window_frame/urban/full
name = "window frame"
diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm
index c93bce70a0d..e02aa9cbc0b 100644
--- a/code/game/objects/structures/window.dm
+++ b/code/game/objects/structures/window.dm
@@ -57,7 +57,7 @@
to_chat(user, SPAN_NOTICE("There is a thick layer of silicate covering it."))
/obj/structure/window/proc/update_nearby_icons()
- queue_smooth_neighbors(src)
+ SSicon_smooth.add_to_queue_neighbors(src)
/obj/structure/window/update_icon()
if(!full)
@@ -65,7 +65,7 @@
layer = ABOVE_MOB_LAYER
else
layer = WINDOW_PANE_LAYER
- queue_smooth(src)
+ SSicon_smooth.add_to_queue(src)
/obj/structure/window/proc/take_damage(var/damage = 0, var/sound_effect = 1, message = TRUE)
var/initialhealth = health
@@ -544,7 +544,7 @@
reinf = TRUE
basestate = "w"
dir = 5
- smooth = SMOOTH_TRUE
+ smoothing_flags = SMOOTH_TRUE
can_be_unanchored = TRUE
layer = 2.99
@@ -563,7 +563,7 @@
icon = 'icons/obj/smooth/skrell_window_purple.dmi'
health = 500
maxhealth = 500
- smooth = SMOOTH_MORE | SMOOTH_DIAGONAL
+ smoothing_flags = SMOOTH_MORE | SMOOTH_DIAGONAL
canSmoothWith = list(
/turf/simulated/wall/shuttle/skrell,
/obj/structure/window/shuttle/skrell
@@ -577,7 +577,7 @@
health = 500
maxhealth = 500
alpha = 255
- smooth = SMOOTH_MORE
+ smoothing_flags = SMOOTH_MORE
canSmoothWith = list(
/obj/structure/window/shuttle/scc_space_ship,
/turf/simulated/wall/shuttle/scc_space_ship
@@ -591,7 +591,7 @@
/obj/structure/window/shuttle/scc_space_ship/cardinal
- smooth = SMOOTH_MORE
+ smoothing_flags = SMOOTH_MORE
/obj/structure/window/shuttle/scc_space_ship/cardinal_smooth(adjacencies, var/list/dir_mods)
dir_mods = handle_blending(adjacencies, dir_mods)
@@ -623,7 +623,7 @@
full = TRUE
layer = 2.99
base_frame = /obj/structure/window_frame
- smooth = SMOOTH_MORE
+ smoothing_flags = SMOOTH_MORE
canSmoothWith = list(
/turf/simulated/wall,
/turf/simulated/wall/r_wall,
@@ -775,17 +775,17 @@
glasstype = /obj/item/stack/material/glass/reinforced
layer = 2.99
base_frame = /obj/structure/window_frame
- smooth = SMOOTH_MORE
+ smoothing_flags = SMOOTH_MORE
/obj/structure/window/full/cardinal_smooth(adjacencies, var/list/dir_mods)
dir_mods = handle_blending(adjacencies, dir_mods)
return ..(adjacencies, dir_mods)
/obj/structure/window_frame/proc/update_nearby_icons()
- queue_smooth_neighbors(src)
+ SSicon_smooth.add_to_queue_neighbors(src)
/obj/structure/window_frame/update_icon()
- queue_smooth(src)
+ SSicon_smooth.add_to_queue(src)
// Indestructible Reinforced Window
/obj/structure/window/full/reinforced/indestructible/attack_hand()
diff --git a/code/game/turfs/simulated/abyss.dm b/code/game/turfs/simulated/abyss.dm
index e7bfc39511d..d904f71a7b4 100644
--- a/code/game/turfs/simulated/abyss.dm
+++ b/code/game/turfs/simulated/abyss.dm
@@ -2,7 +2,7 @@
name = "abyss"
desc = "It stares back at you."
icon = 'icons/turf/smooth/abyss.dmi'
- smooth = SMOOTH_TRUE | SMOOTH_BORDER | SMOOTH_NO_CLEAR_ICON
+ smoothing_flags = SMOOTH_TRUE | SMOOTH_BORDER | SMOOTH_NO_CLEAR_ICON
smoothing_hints = SMOOTHHINT_CUT_F | SMOOTHHINT_ONLY_MATCH_TURF | SMOOTHHINT_TARGETS_NOT_UNIQUE
icon_state = "smooth"
var/static/list/forbidden_types = typecacheof(list(
@@ -43,4 +43,4 @@
..()
/turf/simulated/abyss/is_open()
- return TRUE
\ No newline at end of file
+ return TRUE
diff --git a/code/game/turfs/simulated/shuttle_turfs.dm b/code/game/turfs/simulated/shuttle_turfs.dm
index a454ec34a56..297de339808 100644
--- a/code/game/turfs/simulated/shuttle_turfs.dm
+++ b/code/game/turfs/simulated/shuttle_turfs.dm
@@ -5,7 +5,7 @@
icon = 'icons/turf/smooth/shuttle_wall_dark.dmi'
icon_state = "map-shuttle"
permit_ao = 0
- smooth = SMOOTH_MORE
+ smoothing_flags = SMOOTH_MORE
canSmoothWith = list(
/turf/unsimulated/wall/steel, // Centcomm wall.
/turf/unsimulated/wall/darkshuttlewall, // Centcomm wall.
@@ -25,13 +25,13 @@
. = ..(mapload, MATERIAL_SHUTTLE, MATERIAL_SHUTTLE)
/turf/simulated/wall/shuttle/cardinal
- smooth = SMOOTH_TRUE
+ smoothing_flags = SMOOTH_TRUE
/turf/simulated/wall/shuttle/dark
canSmoothWith = null
/turf/simulated/wall/shuttle/dark/cardinal
- smooth = SMOOTH_MORE
+ smoothing_flags = SMOOTH_MORE
canSmoothWith = list(
/turf/simulated/wall/shuttle/dark,
/obj/structure/shuttle_part/dark,
@@ -58,7 +58,7 @@
name = "test diagonal"
icon_state = "d2-we-1"
use_set_icon_state = TRUE
- smooth = null
+ smoothing_flags = null
canSmoothWith = null
/obj/structure/shuttle_part/dark
@@ -70,7 +70,7 @@
icon = 'icons/turf/shuttle.dmi'
icon_state = "wall3"
use_set_icon_state = 1
- smooth = null
+ smoothing_flags = null
canSmoothWith = null
/turf/simulated/wall/shuttle/dark/corner/underlay
@@ -96,7 +96,7 @@
canSmoothWith = null
/turf/simulated/wall/shuttle/scc_space_ship/cardinal
- smooth = SMOOTH_MORE
+ smoothing_flags = SMOOTH_MORE
canSmoothWith = list(
/turf/simulated/wall,
/turf/simulated/wall/r_wall,
@@ -161,7 +161,7 @@
icon = 'icons/turf/shuttle.dmi'
icon_state = "floor5"
use_set_icon_state = TRUE
- smooth = null
+ smoothing_flags = null
canSmoothWith = null
/obj/structure/shuttle_part //For placing them over space, if the sprite doesn't cover the whole turf.
@@ -187,7 +187,7 @@
icon_state = "wall2"
health = 500
maxhealth = 500
- smooth = null
+ smoothing_flags = null
canSmoothWith = null
can_be_unanchored = FALSE
var/outside_window = FALSE
@@ -571,7 +571,7 @@
name = "shuttle roof"
icon = 'icons/turf/smooth/roof_white.dmi'
icon_state = "roof_white"
- smooth = SMOOTH_DIAGONAL|SMOOTH_TRUE
+ smoothing_flags = SMOOTH_DIAGONAL|SMOOTH_TRUE
smooth_underlays = TRUE
initial_gas = null
roof_type = null
diff --git a/code/game/turfs/simulated/wall_icon.dm b/code/game/turfs/simulated/wall_icon.dm
index 0615607dac8..42a0910013d 100644
--- a/code/game/turfs/simulated/wall_icon.dm
+++ b/code/game/turfs/simulated/wall_icon.dm
@@ -65,12 +65,12 @@
fake_wall_image = image('icons/turf/wall_masks.dmi', "[material.icon_base]fwall_open")
fake_wall_image.color = material.icon_colour
add_overlay(fake_wall_image)
- smooth = SMOOTH_FALSE
+ smoothing_flags = SMOOTH_FALSE
return
else if (fake_wall_image)
cut_overlay(fake_wall_image)
fake_wall_image = null
- smooth = initial(smooth)
+ smoothing_flags = initial(smoothing_flags)
calculate_adjacencies() // Update cached_adjacency
@@ -105,8 +105,8 @@
add_overlay(overlays_to_add, TRUE)
UNSETEMPTY(reinforcement_images)
- queue_smooth(src)
- if(smooth & SMOOTH_UNDERLAYS)
+ SSicon_smooth.add_to_queue(src)
+ if(smoothing_flags & SMOOTH_UNDERLAYS)
get_underlays(cached_adjacency)
/turf/simulated/wall/proc/generate_overlays()
@@ -116,4 +116,4 @@
var/image/img = image(icon = 'icons/turf/walls.dmi', icon_state = "overlay_damage")
img.blend_mode = BLEND_MULTIPLY
img.alpha = (i * alpha_inc) - 1
- damage_overlays[i] = img
\ No newline at end of file
+ damage_overlays[i] = img
diff --git a/code/game/turfs/simulated/wall_types.dm b/code/game/turfs/simulated/wall_types.dm
index 5845e3b2039..4ce82a0bc09 100644
--- a/code/game/turfs/simulated/wall_types.dm
+++ b/code/game/turfs/simulated/wall_types.dm
@@ -29,7 +29,7 @@
desc = "Hideous images dance beneath the surface."
icon = 'icons/turf/smooth/cult_wall.dmi'
canSmoothWith = null
- smooth = SMOOTH_TRUE
+ smoothing_flags = SMOOTH_TRUE
smoothing_hints = SMOOTHHINT_TARGETS_NOT_UNIQUE | SMOOTHHINT_ONLY_MATCH_TURF
icon_state = "cult"
appearance_flags = NO_CLIENT_COLOR
diff --git a/code/game/turfs/simulated/walls.dm b/code/game/turfs/simulated/walls.dm
index ba4622baaf1..81907e9acf8 100644
--- a/code/game/turfs/simulated/walls.dm
+++ b/code/game/turfs/simulated/walls.dm
@@ -43,7 +43,7 @@
var/tmp/image/fake_wall_image
var/tmp/cached_adjacency
- smooth = SMOOTH_MORE | SMOOTH_NO_CLEAR_ICON | SMOOTH_UNDERLAYS
+ smoothing_flags = SMOOTH_MORE | SMOOTH_NO_CLEAR_ICON | SMOOTH_UNDERLAYS
// Walls always hide the stuff below them.
/turf/simulated/wall/levelupdate(mapload)
diff --git a/code/game/turfs/simulated/water.dm b/code/game/turfs/simulated/water.dm
index 47f4baf479a..fc1ffbb1bb3 100644
--- a/code/game/turfs/simulated/water.dm
+++ b/code/game/turfs/simulated/water.dm
@@ -93,7 +93,7 @@
return return_air() // Otherwise their head is above the water, so get the air from the atmosphere instead.
/turf/simulated/floor/beach/water/Entered(atom/movable/AM, atom/oldloc)
- if(!SSATOMS_IS_PROBABLY_DONE)
+ if(!(SSATOMS_IS_PROBABLY_DONE))
return
reagents.add_reagent(/singleton/reagent/water, 2)
clean(src)
diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm
index 4e8ee1fc016..692100828b8 100644
--- a/code/game/turfs/turf.dm
+++ b/code/game/turfs/turf.dm
@@ -75,8 +75,8 @@
else
luminosity = 1
- if (smooth)
- queue_smooth(src)
+ if (smoothing_flags)
+ SSicon_smooth.add_to_queue(src)
if (light_range && light_power)
update_light()
diff --git a/code/game/turfs/turf_changing.dm b/code/game/turfs/turf_changing.dm
index a3be615710c..12b8faa36f1 100644
--- a/code/game/turfs/turf_changing.dm
+++ b/code/game/turfs/turf_changing.dm
@@ -19,9 +19,9 @@
above.update_mimic()
if(queue_neighbors)
- queue_smooth_neighbors(src)
- else if(smooth && !(smooth & SMOOTH_QUEUED)) // we check here because proc overhead
- queue_smooth(src)
+ SSicon_smooth.add_to_queue_neighbors(src)
+ else if(smoothing_flags && !(smoothing_flags & SMOOTH_QUEUED)) // we check here because proc overhead
+ SSicon_smooth.add_to_queue(src)
if (current_map.use_overmap)
var/obj/effect/overmap/visitable/sector/exoplanet/E = map_sectors["[z]"]
diff --git a/code/game/turfs/unsimulated/walls.dm b/code/game/turfs/unsimulated/walls.dm
index 7fb4cdce2ff..c395db057d1 100644
--- a/code/game/turfs/unsimulated/walls.dm
+++ b/code/game/turfs/unsimulated/walls.dm
@@ -21,7 +21,7 @@
icon = 'icons/turf/smooth/riveted.dmi'
icon_state = "riveted"
desc = "It's a wall. It appears to be composed of a highly durable alloy."
- smooth = SMOOTH_TRUE
+ smoothing_flags = SMOOTH_TRUE
canSmoothWith = list(
/turf/unsimulated/wall/riveted,
/obj/machinery/door/airlock/centcom,
@@ -42,7 +42,7 @@
icon_state = "map_readable"//the best approximation of the ingame gunmetal blended wall sprite for example
desc = "It's a wall. It appears to be composed of a highly durable alloy and plated with steel."
color = COLOR_WALL_GUNMETAL
- smooth = SMOOTH_TRUE
+ smoothing_flags = SMOOTH_TRUE
canSmoothWith = list(
/turf/unsimulated/wall/steel,
/obj/structure/window_frame,
@@ -54,7 +54,7 @@
icon = 'icons/turf/smooth/shuttle_wall_dark.dmi'
icon_state = "map-shuttle"
desc = "It's a wall. It appears to be composed of a highly durable alloy."
- smooth = SMOOTH_TRUE
+ smoothing_flags = SMOOTH_TRUE
canSmoothWith = list(
/turf/unsimulated/wall/darkshuttlewall,
/turf/unsimulated/wall/riveted,
@@ -83,6 +83,6 @@
/obj/machinery/door,
/obj/machinery/door/airlock
)
- smooth = SMOOTH_MORE
+ smoothing_flags = SMOOTH_MORE
icon_state = "map_white"
diff --git a/code/modules/maps/map_template.dm b/code/modules/maps/map_template.dm
index 16e97b2e3de..e99b6fe46d2 100644
--- a/code/modules/maps/map_template.dm
+++ b/code/modules/maps/map_template.dm
@@ -48,7 +48,7 @@
var/list/atoms_to_initialise = list()
var/shuttle_state = pre_init_shuttles()
- //Since queue_smooth() manually wakes the subsystem, we have to use enable/disable.
+ //Since SSicon_smooth.add_to_queue() manually wakes the subsystem, we have to use enable/disable.
SSicon_smooth.disable()
for (var/mappath in mappaths)
var/datum/map_load_metadata/M = maploader.load_map(file(mappath), x, y, no_changeturf = no_changeturf)
@@ -162,7 +162,7 @@
var/list/atoms_to_initialise = list()
var/shuttle_state = pre_init_shuttles()
- //Since queue_smooth() manually wakes the subsystem, we have to use enable/disable.
+ //Since SSicon_smooth.add_to_queue() manually wakes the subsystem, we have to use enable/disable.
SSicon_smooth.disable()
for (var/mappath in mappaths)
var/datum/map_load_metadata/M = maploader.load_map(file(mappath), T.x, T.y, T.z, cropMap=TRUE)
@@ -171,7 +171,7 @@
else
SSicon_smooth.enable()
return FALSE
-
+
//initialize things that are normally initialized after map load
init_atoms(atoms_to_initialise)
init_shuttles(shuttle_state)
diff --git a/code/modules/maps/reader.dm b/code/modules/maps/reader.dm
index 924199d3c2f..fa7924dc496 100644
--- a/code/modules/maps/reader.dm
+++ b/code/modules/maps/reader.dm
@@ -307,7 +307,7 @@ var/global/dmm_suite/preloader/_preloader = new
//since we've switched off autoinitialisation, record atoms to initialise later
var/list/atoms_to_initialise = list()
//turn off base new Initialization until the whole thing is loaded
- SSatoms.map_loader_begin()
+ SSatoms.map_loader_begin(text_ref(src))
//The next part of the code assumes there's ALWAYS an /area AND a /turf on a given tile
var/turf/crds = locate(xcrd,ycrd,zcrd)
@@ -355,7 +355,7 @@ var/global/dmm_suite/preloader/_preloader = new
for(index in 1 to first_turf_index-1)
atoms_to_initialise += instance_atom(members[index],members_attributes[index],crds,no_changeturf)
//Restore initialization to the previous value
- SSatoms.map_loader_stop()
+ SSatoms.map_loader_stop(text_ref(src))
var/datum/grid_load_metadata/M = new
M.atoms_to_initialise = atoms_to_initialise
@@ -381,9 +381,9 @@ var/global/dmm_suite/preloader/_preloader = new
//custom CHECK_TICK here because we don't want things created while we're sleeping to not initialize
if(TICK_CHECK)
- SSatoms.map_loader_stop()
+ SSatoms.map_loader_stop(text_ref(src))
stoplag()
- SSatoms.map_loader_begin()
+ SSatoms.map_loader_begin(text_ref(src))
/dmm_suite/proc/create_atom(path, crds)
// Doing this async is impossible, as we must return the ref.
diff --git a/code/modules/mining/mine_turf_types.dm b/code/modules/mining/mine_turf_types.dm
index 1032233a534..4b7432df3ef 100644
--- a/code/modules/mining/mine_turf_types.dm
+++ b/code/modules/mining/mine_turf_types.dm
@@ -5,7 +5,7 @@
icon = 'icons/turf/smooth/lava.dmi'
icon_state = "smooth"
gender = PLURAL
- smooth = SMOOTH_TRUE | SMOOTH_BORDER
+ smoothing_flags = SMOOTH_TRUE | SMOOTH_BORDER
light_color = LIGHT_COLOR_LAVA
light_range = 2
canSmoothWith = list(
@@ -61,7 +61,7 @@
base_icon = 'icons/turf/basalt.dmi'
base_icon_state = "basalt"
light_color = LIGHT_COLOR_LAVA
- smooth = SMOOTH_FALSE
+ smoothing_flags = SMOOTH_FALSE
canSmoothWith = null
openspace_override_type = /turf/simulated/open/chasm/airless
@@ -78,7 +78,7 @@
base_icon = 'icons/turf/basalt.dmi'
base_icon_state = "basalt"
light_color = LIGHT_COLOR_LAVA
- smooth = SMOOTH_FALSE
+ smoothing_flags = SMOOTH_FALSE
canSmoothWith = null
openspace_override_type = /turf/simulated/open/chasm/airless
@@ -115,7 +115,7 @@
name = "ash"
icon_state = "ash"
desc = "A fine grey ash. Looks pretty tightly packed."
- smooth = SMOOTH_MORE | SMOOTH_BORDER | SMOOTH_NO_CLEAR_ICON
+ smoothing_flags = SMOOTH_MORE | SMOOTH_BORDER | SMOOTH_NO_CLEAR_ICON
base_icon = 'icons/turf/smooth/ash.dmi'
base_icon_state = "ash"
footstep_sound = /singleton/sound_category/sand_footstep
diff --git a/code/modules/mining/mine_turfs.dm b/code/modules/mining/mine_turfs.dm
index 0b596964fe6..afbe9528a42 100644
--- a/code/modules/mining/mine_turfs.dm
+++ b/code/modules/mining/mine_turfs.dm
@@ -7,7 +7,7 @@
density = TRUE
gender = PLURAL
opacity = TRUE
- smooth = SMOOTH_TRUE
+ smoothing_flags = SMOOTH_TRUE
color = "#6e632f"
/turf/unsimulated/mineral/konyang
@@ -30,7 +30,7 @@ var/list/mineral_can_smooth_with = list(
layer = ON_TURF_LAYER
// canSmoothWith is set in Initialize().
- smooth = SMOOTH_MORE | SMOOTH_BORDER | SMOOTH_NO_CLEAR_ICON
+ smoothing_flags = SMOOTH_MORE | SMOOTH_BORDER | SMOOTH_NO_CLEAR_ICON
smoothing_hints = SMOOTHHINT_CUT_F | SMOOTHHINT_ONLY_MATCH_TURF | SMOOTHHINT_TARGETS_NOT_UNIQUE
initial_gas = null
@@ -82,7 +82,7 @@ var/list/mineral_can_smooth_with = list(
has_opaque_atom = TRUE
- if(smooth)
+ if(smoothing_flags)
canSmoothWith = mineral_can_smooth_with
pixel_x = -4
pixel_y = -4
@@ -178,7 +178,7 @@ var/list/mineral_can_smooth_with = list(
/turf/unsimulated/mineral,
/turf/unsimulated/mineral/asteroid
)
- smooth = SMOOTH_MORE | SMOOTH_BORDER | SMOOTH_NO_CLEAR_ICON
+ smoothing_flags = SMOOTH_MORE | SMOOTH_BORDER | SMOOTH_NO_CLEAR_ICON
smoothing_hints = SMOOTHHINT_CUT_F | SMOOTHHINT_ONLY_MATCH_TURF | SMOOTHHINT_TARGETS_NOT_UNIQUE
/turf/unsimulated/mineral/asteroid/Initialize(mapload)
@@ -202,7 +202,7 @@ var/list/mineral_can_smooth_with = list(
has_opaque_atom = TRUE
- if(smooth)
+ if(smoothing_flags)
canSmoothWith = asteroid_can_smooth_with
pixel_x = -4
pixel_y = -4
@@ -626,7 +626,7 @@ var/list/mineral_can_smooth_with = list(
icon = 'icons/turf/map_placeholders.dmi'
icon_state = ""
desc = "An exposed developer texture. Someone wasn't paying attention."
- smooth = SMOOTH_FALSE
+ smoothing_flags = SMOOTH_FALSE
smoothing_hints = SMOOTHHINT_CUT_F | SMOOTHHINT_ONLY_MATCH_TURF | SMOOTHHINT_TARGETS_NOT_UNIQUE
gender = PLURAL
base_icon = 'icons/turf/map_placeholders.dmi'
@@ -673,7 +673,7 @@ var/list/asteroid_floor_smooth = list(
if(mapload && permit_ao)
queue_ao()
- if(smooth)
+ if(smoothing_flags)
canSmoothWith = asteroid_floor_smooth
pixel_x = -4
pixel_y = -4
diff --git a/code/modules/mob/living/carbon/human/npcs.dm b/code/modules/mob/living/carbon/human/npcs.dm
index 2885cfc5cd4..40450b89b2b 100644
--- a/code/modules/mob/living/carbon/human/npcs.dm
+++ b/code/modules/mob/living/carbon/human/npcs.dm
@@ -15,6 +15,9 @@
named = TRUE
gender = MALE
+ INVOKE_ASYNC(src, PROC_REF(EquipPunpunUniform))
+
+/mob/living/carbon/human/monkey/punpun/proc/EquipPunpunUniform()
equip_to_slot(new /obj/item/clothing/under/punpun(src), slot_w_uniform)
/obj/item/clothing/under/nupnup
diff --git a/code/modules/multiz/turfs/open_space.dm b/code/modules/multiz/turfs/open_space.dm
index 6776a957604..e5311834d91 100644
--- a/code/modules/multiz/turfs/open_space.dm
+++ b/code/modules/multiz/turfs/open_space.dm
@@ -146,7 +146,7 @@
/turf/simulated/open/chasm
icon = 'icons/turf/smooth/chasms_seethrough.dmi'
icon_state = "debug"
- smooth = SMOOTH_TRUE | SMOOTH_BORDER | SMOOTH_NO_CLEAR_ICON
+ smoothing_flags = SMOOTH_TRUE | SMOOTH_BORDER | SMOOTH_NO_CLEAR_ICON
smoothing_hints = SMOOTHHINT_CUT_F | SMOOTHHINT_ONLY_MATCH_TURF | SMOOTHHINT_TARGETS_NOT_UNIQUE
z_flags = ZM_MIMIC_BELOW
name = "hole"
diff --git a/code/modules/overmap/exoplanets/decor/_turfs.dm b/code/modules/overmap/exoplanets/decor/_turfs.dm
index 5fcb7cfd2df..6eac8cf2bc4 100644
--- a/code/modules/overmap/exoplanets/decor/_turfs.dm
+++ b/code/modules/overmap/exoplanets/decor/_turfs.dm
@@ -129,7 +129,7 @@
icon_state = "snow0"
dirt_color = "#e3e7e8"
footstep_sound = /singleton/sound_category/snow_footstep
- smooth = SMOOTH_MORE | SMOOTH_BORDER | SMOOTH_NO_CLEAR_ICON
+ smoothing_flags = SMOOTH_MORE | SMOOTH_BORDER | SMOOTH_NO_CLEAR_ICON
smoothing_hints = SMOOTHHINT_CUT_F | SMOOTHHINT_ONLY_MATCH_TURF | SMOOTHHINT_TARGETS_NOT_UNIQUE
canSmoothWith = list(
/turf/simulated/floor/exoplanet/snow,
@@ -142,8 +142,8 @@
pixel_x = -4
pixel_y = -4
icon_state = pick("snow[rand(1,2)]","snow0","snow0")
- queue_smooth_neighbors(src)
- queue_smooth(src)
+ SSicon_smooth.add_to_queue_neighbors(src)
+ SSicon_smooth.add_to_queue(src)
/turf/simulated/floor/exoplanet/snow/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume)
melt()
diff --git a/code/modules/overmap/exoplanets/decor/objs/clearing.dm b/code/modules/overmap/exoplanets/decor/objs/clearing.dm
index c420516d46e..1b86bce766a 100644
--- a/code/modules/overmap/exoplanets/decor/objs/clearing.dm
+++ b/code/modules/overmap/exoplanets/decor/objs/clearing.dm
@@ -6,7 +6,7 @@
blend_mode = BLEND_MULTIPLY
density = FALSE
anchored = TRUE
- smooth = SMOOTH_MORE
+ smoothing_flags = SMOOTH_MORE
canSmoothWith = list(
/obj/structure/clearing,
/obj/structure/lattice/catwalk,
diff --git a/code/modules/overmap/exoplanets/decor/turfs/konyang.dm b/code/modules/overmap/exoplanets/decor/turfs/konyang.dm
index 664e49d7d14..9b89ea736b4 100644
--- a/code/modules/overmap/exoplanets/decor/turfs/konyang.dm
+++ b/code/modules/overmap/exoplanets/decor/turfs/konyang.dm
@@ -34,14 +34,14 @@
name = "wilting mossy grass"
icon = 'icons/turf/flooring/exoplanet/konyang/moss_transition_1.dmi'
icon_state = "unsmooth"
- smooth = SMOOTH_MORE | SMOOTH_BORDER | SMOOTH_NO_CLEAR_ICON
+ smoothing_flags = SMOOTH_MORE | SMOOTH_BORDER | SMOOTH_NO_CLEAR_ICON
canSmoothWith = list(/turf/simulated/floor/exoplanet/konyang/wilting, /turf/simulated/floor/exoplanet/konyang/pink)
/turf/simulated/floor/exoplanet/konyang/pink//manually mapped. To be surrounded by wilting grass
name = "blossoming mossy grass"
icon = 'icons/turf/flooring/exoplanet/konyang/moss_transition_2.dmi'
icon_state = "unsmooth"
- smooth = SMOOTH_TRUE
+ smoothing_flags = SMOOTH_TRUE
/turf/simulated/floor/exoplanet/dirt_konyang//a different path entirely so it will allow for edges to generate from grass
name = "compacted dirt"
@@ -57,6 +57,6 @@
icon = 'icons/turf/flooring/exoplanet/konyang/konyang_beach.dmi'
icon_state = "sand"
footstep_sound = /singleton/sound_category/asteroid_footstep
- smooth = SMOOTH_FALSE
+ smoothing_flags = SMOOTH_FALSE
does_footprint = FALSE
has_edge_icon = FALSE
diff --git a/code/modules/overmap/exoplanets/decor/turfs/snow.dm b/code/modules/overmap/exoplanets/decor/turfs/snow.dm
index 3296c2ea858..7adca62f17f 100644
--- a/code/modules/overmap/exoplanets/decor/turfs/snow.dm
+++ b/code/modules/overmap/exoplanets/decor/turfs/snow.dm
@@ -5,7 +5,7 @@
dirt_color = "#e3e7e8"
layer = LOWER_ON_TURF_LAYER
footstep_sound = /singleton/sound_category/snow_footstep
- smooth = SMOOTH_MORE | SMOOTH_BORDER | SMOOTH_NO_CLEAR_ICON
+ smoothing_flags = SMOOTH_MORE | SMOOTH_BORDER | SMOOTH_NO_CLEAR_ICON
smoothing_hints = SMOOTHHINT_CUT_F | SMOOTHHINT_ONLY_MATCH_TURF | SMOOTHHINT_TARGETS_NOT_UNIQUE
canSmoothWith = list(
/turf/simulated/floor/exoplanet/snow,
@@ -18,8 +18,8 @@
pixel_x = -4
pixel_y = -4
icon_state = pick("snow[rand(1,2)]","snow0","snow0")
- queue_smooth_neighbors(src)
- queue_smooth(src)
+ SSicon_smooth.add_to_queue_neighbors(src)
+ SSicon_smooth.add_to_queue(src)
/turf/simulated/floor/exoplanet/snow/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume)
melt()
diff --git a/code/modules/overmap/exoplanets/decor/turfs/water.dm b/code/modules/overmap/exoplanets/decor/turfs/water.dm
index 4eb7f775013..b6fb0fcc404 100644
--- a/code/modules/overmap/exoplanets/decor/turfs/water.dm
+++ b/code/modules/overmap/exoplanets/decor/turfs/water.dm
@@ -13,7 +13,7 @@
icon_state = "unsmooth"
base_icon_state = "unsmooth"
icon = 'icons/turf/flooring/exoplanet/konyang/konyang_deep_water.dmi'
- smooth = SMOOTH_TRUE
+ smoothing_flags = SMOOTH_TRUE
/turf/simulated/floor/exoplanet/water/shallow
name = "shallow water"
@@ -36,15 +36,15 @@
icon_state = "unsmooth"
base_icon_state = "unsmooth"
icon = 'icons/turf/flooring/exoplanet/konyang/konyang_smooth_water.dmi'
- smooth = SMOOTH_MORE | SMOOTH_BORDER | SMOOTH_NO_CLEAR_ICON
+ smoothing_flags = SMOOTH_MORE | SMOOTH_BORDER | SMOOTH_NO_CLEAR_ICON
canSmoothWith = list(/turf/simulated/floor/exoplanet/water/shallow/konyang, /turf/simulated/floor/exoplanet/water/konyang, /turf/simulated/floor/exoplanet/water/shallow/konyang/beach)
/turf/simulated/floor/exoplanet/water/shallow/konyang/no_smooth
- smooth = SMOOTH_FALSE
+ smoothing_flags = SMOOTH_FALSE
/turf/simulated/floor/exoplanet/water/shallow/konyang/beach
icon = 'icons/turf/flooring/exoplanet/konyang/konyang_beach.dmi'
- smooth = SMOOTH_MORE | SMOOTH_BORDER | SMOOTH_NO_CLEAR_ICON
+ smoothing_flags = SMOOTH_MORE | SMOOTH_BORDER | SMOOTH_NO_CLEAR_ICON
canSmoothWith = list(/turf/simulated/floor/exoplanet/water/shallow/konyang, /turf/simulated/floor/exoplanet/water/konyang, /turf/simulated/floor/exoplanet/water/shallow/konyang/beach)
/turf/simulated/floor/exoplanet/water/shallow/sewage//What horror.
diff --git a/html/changelogs/fluffyghost_iconsmoothingsubsystem.yml b/html/changelogs/fluffyghost_iconsmoothingsubsystem.yml
new file mode 100644
index 00000000000..694ae3a5c07
--- /dev/null
+++ b/html/changelogs/fluffyghost_iconsmoothingsubsystem.yml
@@ -0,0 +1,46 @@
+################################
+# Example Changelog File
+#
+# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb.
+#
+# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.)
+# When it is, any changes listed below will disappear.
+#
+# Valid Prefixes:
+# bugfix
+# wip (For works in progress)
+# tweak
+# soundadd
+# sounddel
+# rscadd (general adding of nice things)
+# rscdel (general deleting of nice things)
+# imageadd
+# imagedel
+# maptweak
+# spellcheck (typo fixes)
+# experiment
+# balance
+# admin
+# backend
+# security
+# refactor
+#################################
+
+# Your name.
+author: FluffyGhost
+
+# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again.
+delete-after: True
+
+# Any changes you've made. See valid prefix list above.
+# INDENT WITH TWO SPACES. NOT TABS. SPACES.
+# SCREW THIS UP AND IT WON'T WORK.
+# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries.
+# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog.
+changes:
+ - refactor: "Refactored SSicon_smoothing to be more in line with TG's."
+ - refactor: "Moved some SSicon_smoothing related procs under it."
+ - rscadd: "Added a proc to track the atoms init status from SSatom's perspective."
+ - refactor: "Refactored PunPun's LateInitialize proc to not sleep."
+ - refactor: "Added some DMdocs and SpacemanDMM guards."
+ - refactor: "Refactored atom's smooth to smoothing_flags (TG's)."