Skip to content

Commit

Permalink
Fix the ability to goal the game if the goal location has been alread…
Browse files Browse the repository at this point in the history
…y collected

* Always tells the game that the goal location is uncollected so the goal may still trigger
  • Loading branch information
Ziktofel committed Nov 23, 2024
1 parent a370ca3 commit 77b5fb0
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions worlds/sc2/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1375,13 +1375,10 @@ def get_uncollected_objectives(self) -> typing.List[int]:
location % VICTORY_MODULO for location in
self.ctx.uncollected_locations_in_mission(lookup_id_to_mission[self.mission_id])
]
if self.mission_id in self.ctx.final_mission_ids and not self.ctx.finished_game:
mission_locations = self.ctx.locations_for_mission_id(self.mission_id)
mission_objectives = [location % VICTORY_MODULO for location in mission_locations]
if 0 not in mission_objectives:
# Goal isn't a regular location and the game haven't been goaled yet.
# Mark victory as uncollected so the goal can be sent back by the game
result.append(0)
if self.mission_id in self.ctx.final_mission_ids and not self.ctx.finished_game and 0 not in result:
# Goal isn't a regular location or the goal location has been collected and the game haven't been goaled yet.
# Mark victory as uncollected so the goal can be sent back by the game
result.append(0)
return result

def missions_beaten_count(self):
Expand Down

0 comments on commit 77b5fb0

Please sign in to comment.