diff --git a/code/modules/mapping/merge_conflicts.dm b/code/modules/mapping/merge_conflicts.dm new file mode 100644 index 000000000000..2a2e5a6cc54f --- /dev/null +++ b/code/modules/mapping/merge_conflicts.dm @@ -0,0 +1,16 @@ +// 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/landmarks.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." + +///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!!!" + to_chat(world, SPAN_BOLDANNOUNCE("[msg]")) + CRASH(msg) diff --git a/code/modules/unit_tests/create_and_destroy.dm b/code/modules/unit_tests/create_and_destroy.dm index eb4672b84fc9..55711ba7ecc6 100644 --- a/code/modules/unit_tests/create_and_destroy.dm +++ b/code/modules/unit_tests/create_and_destroy.dm @@ -19,6 +19,8 @@ GLOBAL_VAR_INIT(running_create_and_destroy, FALSE) /obj/item/explosive/grenade/flashbang/cluster_piece, /obj/effect/fake_attacker, /atom/movable/lighting_mask, //leave it alone + //This is meant to fail extremely loud every single time it occurs in any environment in any context, and it falsely alarms when this unit test iterates it. Let's not spawn it in. + /obj/merge_conflict_marker, ) //This turf existing is an error in and of itself ignore += typesof(/turf/baseturf_skipover) diff --git a/colonialmarines.dme b/colonialmarines.dme index 9c3a5868d693..8894e848b687 100644 --- a/colonialmarines.dme +++ b/colonialmarines.dme @@ -1767,6 +1767,7 @@ #include "code\modules\logging\log_category.dm" #include "code\modules\logging\log_holder.dm" #include "code\modules\mapping\map_template.dm" +#include "code\modules\mapping\merge_conflicts.dm" #include "code\modules\mapping\preloader.dm" #include "code\modules\mapping\reader.dm" #include "code\modules\mapping\verify.dm" diff --git a/icons/landmarks.dmi b/icons/landmarks.dmi index 8ebeaef1648b..08b23758beaa 100644 Binary files a/icons/landmarks.dmi and b/icons/landmarks.dmi differ diff --git a/tools/mapmerge2/merge_driver.py b/tools/mapmerge2/merge_driver.py index 39bc1f723e33..8daead9c165c 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)}")