Skip to content

Commit

Permalink
Fix weights edge case
Browse files Browse the repository at this point in the history
  • Loading branch information
Salzkorn committed Nov 8, 2024
1 parent 1bd778d commit a77ddf9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions worlds/sc2/mission_order/mission_pools.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ def pick_balanced_mission(self, world: World, pool: List[int]) -> int:
]
balanced_weights = mission_scores

if sum(balanced_weights) == 0.0:
balanced_weights = [1.0 for _ in balanced_weights]
return world.random.choices(balanced_pool, balanced_weights, k=1)[0]

def pull_specific_mission(self, mission: SC2Mission) -> None:
Expand Down

0 comments on commit a77ddf9

Please sign in to comment.