From 3960ce76aff5fdf8d151ceae18ba9bd0b065573a Mon Sep 17 00:00:00 2001 From: Tim Date: Thu, 9 Nov 2023 23:35:08 -0600 Subject: [PATCH] Add mapping linter to check for duplicate machinery stacked on same tile (#79394) This has happened quite a few times in the past and it'd be a good idea to have a linter catch this common mistake. After digging through the Python code for the mapping linter, it appears the linter wasn't correctly identifying two duplicate objects. I tweaked the code to fix this. --- tools/maplint/lints/multiple_machinery.yml | 4 ++++ tools/maplint/source/lint.py | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 tools/maplint/lints/multiple_machinery.yml diff --git a/tools/maplint/lints/multiple_machinery.yml b/tools/maplint/lints/multiple_machinery.yml new file mode 100644 index 000000000000..942d72b401e5 --- /dev/null +++ b/tools/maplint/lints/multiple_machinery.yml @@ -0,0 +1,4 @@ +/obj/machinery: + banned_neighbors: + /obj/machinery: + identical: true diff --git a/tools/maplint/source/lint.py b/tools/maplint/source/lint.py index 4af9ad5c1cfd..ee86d29be52b 100644 --- a/tools/maplint/source/lint.py +++ b/tools/maplint/source/lint.py @@ -66,7 +66,13 @@ def __init__(self, typepath, data = {}): def matches(self, identified: Content, neighbor: Content): if self.identical: - return neighbor == identified + if identified.path != neighbor.path: + return False + + if identified.var_edits != neighbor.var_edits: + return False + + return True if self.typepath is not None: if self.typepath.matches_path(neighbor.path):