Skip to content

Commit

Permalink
fixes outpost baseturfs
Browse files Browse the repository at this point in the history
  • Loading branch information
tmtmtl30 committed Dec 18, 2023
1 parent 11e6a46 commit 6aab15b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
6 changes: 5 additions & 1 deletion code/modules/mapping/map_template.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 4 additions & 3 deletions code/modules/mapping/reader.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 0 additions & 3 deletions code/modules/overmap/objects/outpost/outpost_types.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6aab15b

Please sign in to comment.