diff --git a/code/__HELPERS/icon_smoothing.dm b/code/__HELPERS/icon_smoothing.dm index b4b9e8e8f42..3e1550f2ed1 100644 --- a/code/__HELPERS/icon_smoothing.dm +++ b/code/__HELPERS/icon_smoothing.dm @@ -341,15 +341,17 @@ DEFINE_BITFIELD(smoothing_junction, list( set_smoothed_icon_state(new_junction) -///Changes the icon state based on the new junction bitmask. +///Changes the icon state based on the new junction bitmask. Returns the old junction value. /atom/proc/set_smoothed_icon_state(new_junction) + . = smoothing_junction smoothing_junction = new_junction icon_state = "[base_icon_state]-[smoothing_junction]" /turf/closed/set_smoothed_icon_state(new_junction) - if(smoothing_flags & SMOOTH_DIAGONAL_CORNERS && new_junction != smoothing_junction) - switch(smoothing_junction) + . = ..() + if(smoothing_flags & SMOOTH_DIAGONAL_CORNERS) + switch(new_junction) if( NORTH_JUNCTION|WEST_JUNCTION, NORTH_JUNCTION|EAST_JUNCTION, @@ -361,7 +363,7 @@ DEFINE_BITFIELD(smoothing_junction, list( SOUTH_JUNCTION|EAST_JUNCTION|SOUTHEAST_JUNCTION ) icon_state = "[base_icon_state]-[smoothing_junction]-d" - if(!fixed_underlay) // Mutable underlays? + if(!fixed_underlay && new_junction != .) // Mutable underlays? var/junction_dir = reverse_ndir(smoothing_junction) var/turned_adjacency = REVERSE_DIR(junction_dir) var/turf/neighbor_turf = get_step(src, turned_adjacency & (NORTH|SOUTH)) @@ -375,7 +377,6 @@ DEFINE_BITFIELD(smoothing_junction, list( underlay_appearance.icon = DEFAULT_UNDERLAY_ICON underlay_appearance.icon_state = DEFAULT_UNDERLAY_ICON_STATE underlays = list(underlay_appearance) - return ..() /turf/open/floor/set_smoothed_icon_state(new_junction) diff --git a/code/game/atoms.dm b/code/game/atoms.dm index b304a4a5972..11114a3d1c0 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -125,7 +125,7 @@ ///Icon-smoothing behavior. var/smoothing_flags = NONE ///What directions this is currently smoothing with. IMPORTANT: This uses the smoothing direction flags as defined in icon_smoothing.dm, instead of the BYOND flags. - var/smoothing_junction = NONE + var/smoothing_junction = null //This starts as null for us to know when it's first set, but after that it will hold a 8-bit mask ranging from 0 to 255. ///Smoothing variable var/top_left_corner ///Smoothing variable