Skip to content

Commit

Permalink
Bugfixes
Browse files Browse the repository at this point in the history
- Exclude update_account_data from tracebacks if it's acting as a
  trivial thunk method
- Ensure we clear pactbreaker kills/bites at day, otherwise someone
  locked in the stocks will erroneously repeat the previous night's
  action if it was a kill or bite
- Fix !myrole in pactbreaker
  • Loading branch information
skizzerz committed Nov 30, 2024
1 parent d94b747 commit cce7f77
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/gamemodes/pactbreaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,8 @@ def on_myrole(self, evt: Event, var: GameState, player: User):
# iterate such that real evidence is always displayed if available by putting those roles last
role_order = ("wolf", "villager", "vigilante", "vampire")
for role in role_order:
for targets in self.collected_evidence[player][role]:
for target in targets:
evidence[target] = role
for target in self.collected_evidence[player][role]:
evidence[target] = role

if not evidence:
evt.data["messages"].append(messages["pactbreaker_info_no_evidence"])
Expand Down Expand Up @@ -489,6 +488,7 @@ def on_begin_day(self, evt: Event, var: GameState):
self.active_players.clear()
self.active_players.update(get_players(var))
self.visiting.clear()
self.killing.clear()
# if someone was locked up last night, ensure they can't be locked up again tonight
if self.last_voted is not None:
add_lynch_immunity(var, self.last_voted, "pactbreaker")
Expand Down
3 changes: 3 additions & 0 deletions src/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,7 @@ def update_account_data(self, command: str, callback: Callable):
passed in the updated user with an accurate account
"""

_ignore_locals_ = True
# Nothing to update for fake nicks
if self.is_fake:
callback(self)
Expand All @@ -590,6 +591,8 @@ def update_account_data(self, command: str, callback: Callable):
callback(self)
return

# at this point we might actually care about locals in tracebacks when debugging account tracking issues
_ignore_locals_ = False
services = get_services()
if self.account and (not services.supports_account_change() or self.account_timestamp > time.time() - 900):
# account data is less than 15 minutes old or we can't change accounts on this ircd,
Expand Down

0 comments on commit cce7f77

Please sign in to comment.