Skip to content

Commit

Permalink
Merge pull request #304 from ElGuillermo/master
Browse files Browse the repository at this point in the history
Fixes an "AttributeError: 'SeedingRulesAutomod'/'LevelThresholdsAutomod' object has no attribute 'player_punish_failed'"
  • Loading branch information
FlorianSW authored Sep 11, 2023
2 parents a630736 + 3e5eb2a commit 27ecab4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions rcon/automods/level_thresholds.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,14 @@ def get_message(
)
return message

def player_punish_failed(self, aplayer):
with self.watch_state(aplayer.team, aplayer.squad) as watch_status:
try:
if punishes := watch_status.punished.get(aplayer.name):
del punishes[-1]
except Exception:
self.logger.exception("tried to cleanup punished time but failed")

def punitions_to_apply(
self,
team_view,
Expand Down
8 changes: 8 additions & 0 deletions rcon/automods/seeding_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,14 @@ def _is_seeding_rule_disabled(self, rule: str) -> bool:
v = v.decode()
return v == "1"

def player_punish_failed(self, aplayer):
with self.watch_state(aplayer.team, aplayer.squad) as watch_status:
try:
if punishes := watch_status.punished.get(aplayer.name):
del punishes[-1]
except Exception:
self.logger.exception("tried to cleanup punished time but failed")

def punitions_to_apply(
self,
team_view,
Expand Down

0 comments on commit 27ecab4

Please sign in to comment.