From 5162c0413c137fc56b94b82d884aba914291d36c Mon Sep 17 00:00:00 2001 From: S34N <12197162+S34NW@users.noreply.github.com> Date: Thu, 11 Aug 2022 15:46:22 +0100 Subject: [PATCH] Fixes queued smoothing items not being removed on del (#18776) * fixes queued smoothing items not being removed on del * undupes the code * why DID it do this? --- code/__DEFINES/icon_smoothing.dm | 2 ++ code/game/objects/structures.dm | 4 ++-- code/game/turfs/turf.dm | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/code/__DEFINES/icon_smoothing.dm b/code/__DEFINES/icon_smoothing.dm index 5602d51d1cb..88f81aa6e7b 100644 --- a/code/__DEFINES/icon_smoothing.dm +++ b/code/__DEFINES/icon_smoothing.dm @@ -27,6 +27,8 @@ DEFINE_BITFIELD(smoothing_flags, list( #define QUEUE_SMOOTH_NEIGHBORS(thing_to_queue) for(var/neighbor in orange(1, thing_to_queue)) {var/atom/atom_neighbor = neighbor; QUEUE_SMOOTH(atom_neighbor)} +#define REMOVE_FROM_SMOOTH_QUEUE(thing_to_remove) if(thing_to_remove.smoothing_flags & SMOOTH_QUEUED) {SSicon_smooth.remove_from_queues(thing_to_remove)} + /**SMOOTHING GROUPS * Groups of things to smooth with. * * Contained in the `list/smoothing_groups` variable. diff --git a/code/game/objects/structures.dm b/code/game/objects/structures.dm index d49803292a2..89148867d72 100644 --- a/code/game/objects/structures.dm +++ b/code/game/objects/structures.dm @@ -30,8 +30,8 @@ GLOB.cameranet.updateVisibility(src) if(smoothing_flags & (SMOOTH_CORNERS|SMOOTH_BITMASK)) var/turf/T = get_turf(src) - spawn(0) - QUEUE_SMOOTH_NEIGHBORS(T) + QUEUE_SMOOTH_NEIGHBORS(T) + REMOVE_FROM_SMOOTH_QUEUE(src) return ..() /obj/structure/proc/climb_on() diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index f5af9303822..7c0bba95084 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -88,6 +88,7 @@ for(var/A in B.contents) qdel(A) return + REMOVE_FROM_SMOOTH_QUEUE(src) // Adds the adjacent turfs to the current atmos processing for(var/turf/simulated/T in atmos_adjacent_turfs) SSair.add_to_active(T)