Skip to content

Commit

Permalink
Port TG Tooling Fix in MapMerge (#5527)
Browse files Browse the repository at this point in the history
# About the pull request

This PR ports tgstation/tgstation#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
<details>
<summary>Screenshots & Videos</summary>

Put screenshots and videos here with an empty line between the
screenshots and the `<details>` tags.

</details>


# Changelog
No player facing changes.
  • Loading branch information
Drulikar authored Jan 25, 2024
1 parent 8bceca2 commit fc82825
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tools/UpdatePaths/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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<path>[^{]*)\s*(\{(?P<props>.*)\})?')

#urgent todo: replace with actual parser, this is slow as janitor in crit
Expand Down
2 changes: 1 addition & 1 deletion tools/mapmerge2/dmm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit fc82825

Please sign in to comment.