Skip to content

Commit 5a5956f

Browse files
AmbratolmAmbratolm
authored andcommitted
Truly lol Fixed attack gold_penalty value validation bug
1 parent b6e30b3 commit 5a5956f

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

db/attack.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -167,13 +167,15 @@ def perform(self):
167167
),
168168
),
169169
) # Modifier decreases if winner level > loser level, increases otherwise
170-
self.gold_penalty = int(
171-
min(
172-
(
173-
loser.gold
174-
* (self.GOLD_PENALTY_FACTOR_BASE * self.gold_penalty_modifier)
175-
),
176-
self.GOLD_PENALTY_MAX,
170+
self.gold_penalty = abs(
171+
int(
172+
min(
173+
(
174+
loser.gold
175+
* (self.GOLD_PENALTY_FACTOR_BASE * self.gold_penalty_modifier)
176+
),
177+
self.GOLD_PENALTY_MAX,
178+
)
177179
)
178180
)
179181

0 commit comments

Comments
 (0)