From 6aab15b4f57faacc532fd3cf045e7cd104c72e75 Mon Sep 17 00:00:00 2001 From: tmtmtl30 Date: Sun, 17 Dec 2023 22:19:59 -0800 Subject: [PATCH] fixes outpost baseturfs --- code/modules/mapping/map_template.dm | 6 +++++- code/modules/mapping/reader.dm | 7 ++++--- code/modules/overmap/objects/outpost/outpost_types.dm | 3 --- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/code/modules/mapping/map_template.dm b/code/modules/mapping/map_template.dm index b3f5b1078b20..fe66d3a99836 100644 --- a/code/modules/mapping/map_template.dm +++ b/code/modules/mapping/map_template.dm @@ -7,7 +7,11 @@ var/datum/parsed_map/cached_map var/keep_cached_map = FALSE - ///if true, turfs loaded from this template are placed on top of the turfs already there, defaults to TRUE + /// Defaults to TRUE. + /// If TRUE, the baseturfs of the new turfs (ignoring baseturf_bottom and space) are added + /// to the top of the pre-existing baseturf lists, in accordance with the behavior of PlaceOnTop. + /// If FALSE, the old turfs are replaced entirely, including their baseturfs. + /// Note that FALSE-case behavior is altered from the original implementation, which ignored baseturfs entirely; it was intended for holodecks, which have been removed. var/should_place_on_top = TRUE ///if true, creates a list of all atoms created by this template loading, defaults to FALSE diff --git a/code/modules/mapping/reader.dm b/code/modules/mapping/reader.dm index 9e12fb7d4ce7..3a8e2706d6b6 100644 --- a/code/modules/mapping/reader.dm +++ b/code/modules/mapping/reader.dm @@ -494,14 +494,15 @@ GLOBAL_LIST_EMPTY(map_model_default) if(members_attributes[index] != default_list) world.preloader_setup(members_attributes[index], members[index]) + var/turf/new_turf_type = members[index] // Note: we make the assertion that the last path WILL be a turf. if it isn't, this will fail. var/old_virtual_z = crds.virtual_z if(placeOnTop) - instance = crds.PlaceOnTop(null, members[index], CHANGETURF_DEFER_CHANGE | (no_changeturf ? CHANGETURF_SKIP : NONE)) + instance = crds.PlaceOnTop(null, new_turf_type, CHANGETURF_DEFER_CHANGE | (no_changeturf ? CHANGETURF_SKIP : NONE)) else if(!no_changeturf) - instance = crds.ChangeTurf(members[index], null, CHANGETURF_DEFER_CHANGE) + instance = crds.ChangeTurf(new_turf_type, initial(new_turf_type.baseturfs), CHANGETURF_DEFER_CHANGE) else - instance = create_turf(members[index], crds , old_virtual_z)//first preloader pass + instance = create_turf(new_turf_type, crds , old_virtual_z)//first preloader pass var/turf/new_turf = instance new_turf.virtual_z = old_virtual_z //UNDER NO CIRCUMSTANCES LOOSE THIS VARIABLE diff --git a/code/modules/overmap/objects/outpost/outpost_types.dm b/code/modules/overmap/objects/outpost/outpost_types.dm index f6809b498960..670a916721ae 100644 --- a/code/modules/overmap/objects/outpost/outpost_types.dm +++ b/code/modules/overmap/objects/outpost/outpost_types.dm @@ -3,9 +3,6 @@ */ /datum/map_template/outpost - // ! TODO: change build_coordinate so that placeOnTop == FALSE passes new turf's baseturfs to ChangeTurf. - // ! this would cause maploading a should_place_on_top == FALSE template to reset the baseturfs to those of the turf instead of - // ! causing it to CLEAR the turf's baseturfs. this will require a holodeck removal, as they're the main thing that uses should_place_on_top == FALSE // Necessary to stop planetary outposts from having space underneath all their turfs. // They were being "placed on top", so instead of their baseturf, there was just space underneath. // (Interestingly, this is much less of a problem for ruins: PlaceOnTop ignores the top closed turf in the baseturfs stack