Skip to content

Commit 38d0845

Browse files
authored
Merge pull request #146 from doluk/patch-2
Fix calculation of WarClan.total_attacks
2 parents 2303e39 + 0dfc637 commit 38d0845

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

coc/war_clans.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def _from_data(self, data: dict) -> None:
104104

105105
if self._war:
106106
self.max_stars: int = self._war.team_size * 3
107-
self.total_attacks: int = self._war.team_size * 2
107+
self.total_attacks: int = self._war.team_size * self._war.attacks_per_member
108108
else:
109109
self.max_stars: int = (data_get("teamSize") or 0) * 3
110110
self.total_attacks: int = (data_get("teamSize") or 0) * 3

coc/wars.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def _from_data(self, data: dict) -> None:
103103
self.start_time = try_enum(Timestamp, data=data_get("startTime"))
104104
self.end_time = try_enum(Timestamp, data=data_get("endTime"))
105105
self.war_tag: str = data_get("tag")
106-
if data_get("attacksPerMember") is None and self.is_cwl:
106+
if data_get("attacksPerMember") is None or self.is_cwl:
107107
self.attacks_per_member: int = 1
108108
else:
109109
self.attacks_per_member: int = data_get("attacksPerMember")

0 commit comments

Comments
 (0)