Skip to content

Commit

Permalink
Clean things up after players quit in join phase
Browse files Browse the repository at this point in the history
Fixes #486
Fixes #487
  • Loading branch information
skizzerz committed Dec 5, 2021
1 parent ce60e00 commit ab2c61f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/gamejoin.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,9 @@ def leave_game(wrapper: MessageDispatcher, message: str):

add_dying(var, wrapper.source, "bot", "quit", death_triggers=False)
kill_players(var)
if len(get_players(var)) == 0:
from src.wolfgame import reset
reset(var)

@command("fleave", flag="A", pm=True, phases=("join", "day", "night"))
def fleave(wrapper: MessageDispatcher, message: str):
Expand Down
2 changes: 2 additions & 0 deletions src/votes.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,8 @@ def on_del_player(evt: Event, var: GameState, player: User, allroles: set[str],

if player in ABSTAINS:
ABSTAINS.remove(player)
elif var.current_phase == "join":
del GAMEMODE_VOTES[:player:]

@event_listener("transition_day_begin")
def on_transition_day_begin(evt: Event, var: GameState):
Expand Down

0 comments on commit ab2c61f

Please sign in to comment.