mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2025-12-16 21:22:13 +00:00
Integrating mapmerge2 checks into Travis (#5616)
Okay, this update is kinda big. Summary: - Trimmed unused keys in Exodus telecomms - Adds script that will run mapmerge2 on Travis to check branch for unused keys or key overflow, etc. - Fixes matching indentation style in tag-matcher and converts it to use Python 3.6 - Converts mapmerge2 to be used by Python 3.4 and above. Instead of 3.6 - Removes Windows 1252 characters from Communication-blackout.dm that were not able to be seen in UTF-8 format. Note: the last commit will fail because currently main level is broken Example of no map issues:  Example of issues: 
This commit is contained in:
committed by
Werner
parent
d230a60a20
commit
779f8a0733
@@ -7,14 +7,14 @@ from collections import defaultdict
|
||||
def merge_map(new_map, old_map, delete_unused=False):
|
||||
if new_map.key_length != old_map.key_length:
|
||||
print("Warning: Key lengths differ, taking new map")
|
||||
print(f" Old: {old_map.key_length}")
|
||||
print(f" New: {new_map.key_length}")
|
||||
print(" Old: {}".format(old_map.key_length))
|
||||
print(" New: {}".format(new_map.key_length))
|
||||
return new_map
|
||||
|
||||
if new_map.size != old_map.size:
|
||||
print("Warning: Map dimensions differ, taking new map")
|
||||
print(f" Old: {old_map.size}")
|
||||
print(f" New: {new_map.size}")
|
||||
print(" Old: {}".format(old_map.size))
|
||||
print(" New: {}".format(new_map.size))
|
||||
return new_map
|
||||
|
||||
key_length, size = old_map.key_length, old_map.size
|
||||
@@ -66,7 +66,7 @@ def merge_map(new_map, old_map, delete_unused=False):
|
||||
|
||||
# step two: delete unused keys
|
||||
if unused_keys:
|
||||
print(f"Notice: Trimming {len(unused_keys)} unused dictionary keys.")
|
||||
print("Notice: Trimming {} unused dictionary keys.".format(len(unused_keys)))
|
||||
for key in unused_keys:
|
||||
del merged.dictionary[key]
|
||||
|
||||
@@ -75,10 +75,10 @@ def merge_map(new_map, old_map, delete_unused=False):
|
||||
new_tile = new_map.dictionary[new_map.grid[x, y, z]]
|
||||
merged_tile = merged.dictionary[merged.grid[x, y, z]]
|
||||
if new_tile != merged_tile:
|
||||
print(f"Error: the map has been mangled! This is a mapmerge bug!")
|
||||
print(f"At {x},{y},{z}.")
|
||||
print(f"Should be {new_tile}")
|
||||
print(f"Instead is {merged_tile}")
|
||||
print("Error: the map has been mangled! This is a mapmerge bug!")
|
||||
print("At {},{},{}.".format(x, y, z))
|
||||
print("Should be {}".format(new_tile))
|
||||
print("Instead is {}".format(merged_tile))
|
||||
raise RuntimeError()
|
||||
|
||||
return merged
|
||||
|
||||
Reference in New Issue
Block a user