From 8d0e1fede34ac4ea994835567144ea0bce16c7db Mon Sep 17 00:00:00 2001 From: Y0SH1M4S73R Date: Mon, 6 Jan 2025 21:21:06 -0500 Subject: [PATCH] Fixes shuttles leaving replaced floors behind (#88848) ## About The Pull Request The splitting of the `PlaceOnTop` proc in #79702 removed the call to `PlaceOnTopReact` that shuttle areas use to place shuttle baseturf skipovers under any plating placed on them. This is the underlying cause of repaired shuttle tiles getting left behind when the shuttle moves. This PR was originally part of #88493, but has been atomized out because if that PR ever gets merged, it's going to be many weeks before it does. ## Why It's Good For The Game Fixes #81099 ## Changelog :cl: fix: Replaced floor tiles on shuttles no longer get left behind when the shuttle moves. /:cl: --- code/game/area/areas.dm | 4 ++-- code/game/area/areas/shuttles.dm | 8 ++++---- code/game/turfs/baseturfs.dm | 4 +++- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm index 1a1720b75f0..de2b9ebb6c2 100644 --- a/code/game/area/areas.dm +++ b/code/game/area/areas.dm @@ -608,8 +608,8 @@ GLOBAL_LIST_EMPTY(teleportlocs) /area/drop_location() CRASH("Bad op: area/drop_location() called") -/// A hook so areas can modify the incoming args (of what??) -/area/proc/PlaceOnTopReact(list/new_baseturfs, turf/fake_turf_type, flags) +/// A hook so areas can modify the incoming args of ChangeTurf +/area/proc/place_on_top_react(list/new_baseturfs, turf/added_layer, flags) return flags diff --git a/code/game/area/areas/shuttles.dm b/code/game/area/areas/shuttles.dm index 490a4d60c2e..f93f0ca4c5a 100644 --- a/code/game/area/areas/shuttles.dm +++ b/code/game/area/areas/shuttles.dm @@ -17,11 +17,11 @@ sound_environment = SOUND_ENVIRONMENT_ROOM -/area/shuttle/PlaceOnTopReact(list/new_baseturfs, turf/fake_turf_type, flags) +/area/shuttle/place_on_top_react(list/new_baseturfs, turf/added_layer, flags) . = ..() - if(length(new_baseturfs) > 1 || fake_turf_type) - return // More complicated larger changes indicate this isn't a player - if(ispath(new_baseturfs[1], /turf/open/floor/plating)) + if(ispath(added_layer, /turf/open/floor/plating)) + new_baseturfs.Add(/turf/baseturf_skipover/shuttle) + else if(ispath(new_baseturfs[1], /turf/open/floor/plating)) new_baseturfs.Insert(1, /turf/baseturf_skipover/shuttle) ////////////////////////////Multi-area shuttles//////////////////////////// diff --git a/code/game/turfs/baseturfs.dm b/code/game/turfs/baseturfs.dm index b65d1a6b71d..29a288b1b59 100644 --- a/code/game/turfs/baseturfs.dm +++ b/code/game/turfs/baseturfs.dm @@ -34,13 +34,15 @@ new_baseturfs.Add(baseturfs) if(isopenturf(src)) new_baseturfs.Add(type) + var/area/our_area = get_area(src) + flags = our_area.place_on_top_react(new_baseturfs, added_layer, flags) return ChangeTurf(added_layer, new_baseturfs, flags) /// Places a turf on top - for map loading /turf/proc/load_on_top(turf/added_layer, flags) var/area/our_area = get_area(src) - flags = our_area.PlaceOnTopReact(list(baseturfs), added_layer, flags) + flags = our_area.place_on_top_react(list(baseturfs), added_layer, flags) if(flags & CHANGETURF_SKIP) // We haven't been initialized if(flags_1 & INITIALIZED_1)