mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-31 09:08:30 +01:00
Fix bounds check for map bogus keys in maptools (#77283)
Prevents rare cases of map merge eating your map
This commit is contained in:
@@ -95,7 +95,7 @@ class DMM:
|
||||
# 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:
|
||||
|
||||
Reference in New Issue
Block a user