Skip to content

Commit

Permalink
Bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
skizzerz committed Nov 8, 2023
1 parent 37bd763 commit 5f61df1
Showing 1 changed file with 3 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 @@ -225,7 +225,7 @@ def on_transition_day_begin(self, evt: Event, var: GameState):

# at most one person can be in the stocks; this simplifies some later logic
target = list(stocks_players)[0] if stocks_players else None
target_role = get_main_role(var, target)
target_role = get_main_role(var, target) if target else None
random.shuffle(deck)
for i, visitor in enumerate(visitors):
role = get_main_role(var, visitor)
Expand Down Expand Up @@ -365,7 +365,7 @@ def on_transition_day_begin(self, evt: Event, var: GameState):
else:
visitor.send(messages["pactbreaker_house_empty_1"].format(owner))

if num_vampires > 0 and num_vampires >= num_visitors / 2:
if not is_home and num_vampires > 0 and num_vampires >= num_visitors / 2:
# vampires outnumber non-vampires; drain the non-vampires
vampires = [x for x in visitors if get_main_role(var, x) == "vampire"]
i = 0
Expand Down Expand Up @@ -494,7 +494,7 @@ def visit(self, wrapper: MessageDispatcher, message: str):
if is_special:
wrapper.pm(messages["pactbreaker_visiting_{0}".format(target_location.name)])
else:
wrapper.pm(messages["pactbreaker_visiting_house"].format(target_location.name))
wrapper.pm(messages["pactbreaker_visiting_house"].format(target_player))

# relay to wolfchat/vampire chat as appropriate
if is_special:
Expand Down

0 comments on commit 5f61df1

Please sign in to comment.