From a1445ee3f0382806aabba10697cbf12e94704088 Mon Sep 17 00:00:00 2001 From: Kashargul <144968721+Kashargul@users.noreply.github.com> Date: Tue, 11 Mar 2025 21:32:39 +0100 Subject: [PATCH] fix runtime in change turf (#17311) --- code/game/turfs/turf_changing.dm | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/code/game/turfs/turf_changing.dm b/code/game/turfs/turf_changing.dm index 755cda00de5..8375496cce5 100644 --- a/code/game/turfs/turf_changing.dm +++ b/code/game/turfs/turf_changing.dm @@ -146,16 +146,17 @@ propogate_sunlight_changes(oldtype, old_density, W) var/turf/simulated/cur_turf = src - if(istype(cur_turf) && is_open != was_open) - do - cur_turf = GetBelow(cur_turf) - var/area/A = cur_turf.loc - if(is_open && !A.isAlwaysIndoors()) - cur_turf.make_outdoors() - else - cur_turf.make_indoors() - cur_turf.propogate_sunlight_changes(oldtype, old_density, W, above = TRUE) - while(istype(cur_turf,/turf/simulated/open) && HasBelow(cur_turf.z)) + if(istype(cur_turf)) + if(is_open != was_open) + do + cur_turf = GetBelow(cur_turf) + var/area/A = cur_turf.loc + if(is_open && !A.isAlwaysIndoors()) + cur_turf.make_outdoors() + else + cur_turf.make_indoors() + cur_turf.propogate_sunlight_changes(oldtype, old_density, W, above = TRUE) + while(istype(cur_turf,/turf/simulated/open) && HasBelow(cur_turf.z)) if(old_shandler) old_shandler.holder_change() if(preserve_outdoors)