Skip to content

Commit

Permalink
fix TypeErrors with unknown mon level
Browse files Browse the repository at this point in the history
  • Loading branch information
Sprintnudel committed Apr 8, 2023
1 parent 7d684af commit aed43d8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion PokeAlarm/Events/MonEvent.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def __init__(self, data):
self.atk_iv = check_for_none(int, data.get("individual_attack"), Unknown.TINY)
self.def_iv = check_for_none(int, data.get("individual_defense"), Unknown.TINY)
self.sta_iv = check_for_none(int, data.get("individual_stamina"), Unknown.TINY)
if Unknown.is_not(self.atk_iv, self.def_iv, self.sta_iv):
if Unknown.is_not(self.atk_iv, self.def_iv, self.sta_iv, self.mon_lvl):
self.iv = 100 * (self.atk_iv + self.def_iv + self.sta_iv) / float(45)
(
self.great_product,
Expand Down
4 changes: 2 additions & 2 deletions PokeAlarm/Utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,7 @@ def get_xl_candy_costs():


def calculate_candy_cost(start_level, target_level, evo_candy_cost=0):
if start_level >= target_level:
if Unknown.is_(start_level) or start_level >= target_level:
return (0, 0)

candy_costs = get_candy_costs()
Expand All @@ -771,7 +771,7 @@ def calculate_candy_cost(start_level, target_level, evo_candy_cost=0):


def calculate_stardust_cost(start_level, target_level):
if start_level >= target_level:
if Unknown.is_(start_level) or start_level >= target_level:
return 0

stardust_costs = get_stardust_costs()
Expand Down

0 comments on commit aed43d8

Please sign in to comment.