From fc828250ec89d2088dc7ac6eb653e3eec120f900 Mon Sep 17 00:00:00 2001 From: Drathek <76988376+Drulikar@users.noreply.github.com> Date: Wed, 24 Jan 2024 22:57:54 -0800 Subject: [PATCH] Port TG Tooling Fix in MapMerge (#5527) # About the pull request This PR ports https://github.com/tgstation/tgstation/pull/77283 and corrects an incorrect default value in update paths. # Explain why it's good for the game Fixes an edge case with map merge tools. # Testing Photographs and Procedure
Screenshots & Videos Put screenshots and videos here with an empty line between the screenshots and the `
` tags.
# Changelog No player facing changes. --- tools/UpdatePaths/__main__.py | 2 +- tools/mapmerge2/dmm.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/UpdatePaths/__main__.py b/tools/UpdatePaths/__main__.py index b283257c1234..a8bf8263e9b9 100644 --- a/tools/UpdatePaths/__main__.py +++ b/tools/UpdatePaths/__main__.py @@ -27,7 +27,7 @@ property = @UNSET - will apply the rule only if the property is not mapedited """ -default_map_directory = "../maps" +default_map_directory = "../../maps" replacement_re = re.compile(r'\s*(?P[^{]*)\s*(\{(?P.*)\})?') #urgent todo: replace with actual parser, this is slow as janitor in crit diff --git a/tools/mapmerge2/dmm.py b/tools/mapmerge2/dmm.py index 5702ed21edc7..bc12a39b3556 100644 --- a/tools/mapmerge2/dmm.py +++ b/tools/mapmerge2/dmm.py @@ -95,7 +95,7 @@ def _presave_checks(self): # last-second handling of bogus keys to help prevent and fix broken maps self._ensure_free_keys(0) max_key = max_key_for(self.key_length) - bad_keys = {key: 0 for key in self.dictionary.keys() if key > max_key} + bad_keys = {key: 0 for key in self.dictionary.keys() if key >= max_key} if bad_keys: print(f"Warning: fixing {len(bad_keys)} overflowing keys") for k in bad_keys: