diff --git a/code/modules/mapping/mapping_helpers.dm b/code/modules/mapping/mapping_helpers.dm index df38a2b258e..5f146b73f47 100644 --- a/code/modules/mapping/mapping_helpers.dm +++ b/code/modules/mapping/mapping_helpers.dm @@ -97,7 +97,6 @@ ..() return late ? INITIALIZE_HINT_LATELOAD : INITIALIZE_HINT_QDEL - //airlock helpers /obj/effect/mapping_helpers/airlock layer = DOOR_HELPER_LAYER diff --git a/code/modules/mapping/merge_conflicts.dm b/code/modules/mapping/merge_conflicts.dm new file mode 100644 index 00000000000..4a7ffb36f50 --- /dev/null +++ b/code/modules/mapping/merge_conflicts.dm @@ -0,0 +1,18 @@ +// Used by mapmerge2 to denote the existence of a merge conflict (or when it has to complete a "best intent" merge where it dumps the movable contents of an old key and a new key on the same tile). +// We define it explicitly here to ensure that it shows up on the highest possible plane (while giving off a verbose icon) to aide mappers in resolving these conflicts. +// DO NOT USE THIS IN NORMAL MAPPING!!! Linters WILL fail. + +/obj/merge_conflict_marker + name = "Merge Conflict Marker - DO NOT USE" + icon = 'icons/effects/mapping_helpers.dmi' + icon_state = "merge_conflict_marker" + desc = "If you are seeing this in-game: someone REALLY, REALLY, REALLY fucked up. They physically mapped in a fucking Merge Conflict Marker. What the shit." + plane = POINT_PLANE + +///We REALLY do not want un-addressed merge conflicts in maps for an inexhaustible list of reasons. This should help ensure that this will not be missed in case linters fail to catch it for any reason what-so-ever. +/obj/merge_conflict_marker/Initialize(mapload) + . = ..() + var/msg = "HEY, LISTEN!!! Merge Conflict Marker detected at [AREACOORD(src)]! Please manually address all potential merge conflicts!!!" + log_mapping(msg) + to_chat(world, span_boldannounce("[msg]")) + warning(msg) diff --git a/icons/effects/mapping_helpers.dmi b/icons/effects/mapping_helpers.dmi index 7f65488aa9b..cec45916b68 100644 Binary files a/icons/effects/mapping_helpers.dmi and b/icons/effects/mapping_helpers.dmi differ diff --git a/tgstation.dme b/tgstation.dme index 688b8e70355..2822bfefe29 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -3339,6 +3339,7 @@ #include "code\modules\mapping\access_helpers.dm" #include "code\modules\mapping\map_template.dm" #include "code\modules\mapping\mapping_helpers.dm" +#include "code\modules\mapping\merge_conflicts.dm" #include "code\modules\mapping\preloader.dm" #include "code\modules\mapping\reader.dm" #include "code\modules\mapping\ruins.dm" diff --git a/tools/ci/check_grep.sh b/tools/ci/check_grep.sh index b4267280311..55d81b57061 100755 --- a/tools/ci/check_grep.sh +++ b/tools/ci/check_grep.sh @@ -15,7 +15,12 @@ if grep -P '//' _maps/**/*.dmm | grep -v '//MAP CONVERTED BY dmm2tgm.py THIS HEA echo "ERROR: Unexpected commented out line detected in this map file. Please remove it." st=1 fi; -if grep -P 'Merge conflict marker' _maps/**/*.dmm; then +if grep -P 'Merge Conflict Marker' _maps/**/*.dmm; then + echo "ERROR: Merge conflict markers detected in map, please resolve all merge failures!" + st=1 +fi; +# We check for this as well to ensure people aren't actually using this mapping effect in their maps. +if grep -P '/obj/merge_conflict_marker' _maps/**/*.dmm; then echo "ERROR: Merge conflict markers detected in map, please resolve all merge failures!" st=1 fi; diff --git a/tools/mapmerge2/merge_driver.py b/tools/mapmerge2/merge_driver.py index 39bc1f723e3..5ce86632d0b 100644 --- a/tools/mapmerge2/merge_driver.py +++ b/tools/mapmerge2/merge_driver.py @@ -75,9 +75,13 @@ def three_way_merge(base, left, right): print(f" C: Both sides touch the tile at {coord}") if merged_movables is None: - obj_name = "---Merge conflict marker---" - merged_movables = left_movables + [f'/obj{{name = "{obj_name}"}}'] + right_movables - print(f" Left and right movable groups are split by an `/obj` named \"{obj_name}\"") + # Note that if you do not have an object that matches this path in your DME, the invalid path may be discarded when the map is loaded into a map editor. + # To rectify this, either add an object with this same path, or create a new object/denote an existing object in the obj_path define. + obj_path = "/obj/merge_conflict_marker" + obj_name = "---Merge Conflict Marker---" + obj_desc = "A best-effort merge was performed. You must resolve this conflict yourself (manually) and remove this object once complete." + merged_movables = left_movables + [f'{obj_path}{{name = "{obj_name}",\n\tdesc = "{obj_desc}"}}'] + right_movables + print(f" Left and right movable groups are split by an `{obj_path}` named \"{obj_name}\"") if merged_turfs is None: merged_turfs = left_turfs print(f" Saving turf: {', '.join(left_turfs)}")