Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes merge conflict markers #4853

Merged
merged 5 commits into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions code/modules/mapping/merge_conflicts.dm
Original file line number Diff line number Diff line change
@@ -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]"))
warning(msg)
harryob marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 2 additions & 0 deletions code/modules/unit_tests/create_and_destroy.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions colonialmarines.dme
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Binary file modified icons/landmarks.dmi
Binary file not shown.
10 changes: 7 additions & 3 deletions tools/mapmerge2/merge_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)}")
Expand Down