Skip to content

Commit

Permalink
Fix serialisation issue if there is no ability affecting encounters a…
Browse files Browse the repository at this point in the history
…ctive (#485)
  • Loading branch information
hanzi authored Nov 4, 2024
1 parent d78c632 commit 05d2446
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/map.py
Original file line number Diff line number Diff line change
Expand Up @@ -1929,7 +1929,7 @@ def __eq__(self, other):
def to_dict(self) -> dict:
return {
"repel_level": self.repel_level,
"active_ability": self.active_ability.name,
"active_ability": self.active_ability.name if self.active_ability is not None else None,
"regular": self.regular_encounters.to_dict(),
"effective": {
"land_encounters": [encounter.to_dict() for encounter in self.land_encounters],
Expand All @@ -1950,7 +1950,7 @@ def get_effective_encounter_rates_for_current_map() -> EffectiveWildEncounterLis

player = get_player_avatar()
if player is None:
return EffectiveWildEncounterList(0, 0, 0, WildEncounterList.empty(), [], [], [], [], [], [])
return EffectiveWildEncounterList(0, 0, 0, None, WildEncounterList.empty(), [], [], [], [], [], [])

map_group, map_number = player.map_group_and_number

Expand Down

0 comments on commit 05d2446

Please sign in to comment.