Core: check that location address is unique per player (#2429)

This commit is contained in:
Fabian Dill 2023-11-15 20:50:00 +01:00 committed by GitHub
parent 28a20391ab
commit 829c664304
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -354,6 +354,9 @@ def main(args, seed=None, baked_server_options: Optional[Dict[str, object]] = No
assert location.item.code is not None, "item code None should be event, " \ assert location.item.code is not None, "item code None should be event, " \
"location.address should then also be None. Location: " \ "location.address should then also be None. Location: " \
f" {location}" f" {location}"
assert location.address not in locations_data[location.player], (
f"Locations with duplicate address. {location} and "
f"{locations_data[location.player][location.address]}")
locations_data[location.player][location.address] = \ locations_data[location.player][location.address] = \
location.item.code, location.item.player, location.item.flags location.item.code, location.item.player, location.item.flags
if location.name in world.worlds[location.player].options.start_location_hints: if location.name in world.worlds[location.player].options.start_location_hints: