Skip to content

Commit

Permalink
made the controllflow for map-assignment a bit more obvious
Browse files Browse the repository at this point in the history
  • Loading branch information
CommanderStorm committed Aug 11, 2024
1 parent d7f04d9 commit 33b21b3
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions data/processors/maps/roomfinder.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,16 +176,13 @@ def assign_default_roomfinder_map(data: dict[str, dict[str, Any]]) -> None:
for entry in data.values():
if rf_maps := entry.get("maps", {}).get("roomfinder"):
rf_maps.setdefault("default", None)
if not rf_maps.get("available", None):
continue
if available_maps := rf_maps.get("available", None):
default_map = available_maps[0]
for _map in available_maps:
if int(_map["scale"]) < int(default_map["scale"]):
default_map = _map

available_maps = rf_maps["available"]
default_map = available_maps[0]
for _map in available_maps:
if int(_map["scale"]) < int(default_map["scale"]):
default_map = _map

rf_maps["default"] = default_map["id"]
rf_maps["default"] = default_map["id"]


def _generate_assignment_data() -> dict[str, roomfinder.Map]:
Expand Down

0 comments on commit 33b21b3

Please sign in to comment.