Skip to content

Commit

Permalink
Fix visiting houses with no previous location set
Browse files Browse the repository at this point in the history
e.g. n1 or when they were in the stocks. Previously lack of location
defaulted to "visiting a house" which would prevent someone from
visiting a house in the above situations. Now it defaults to them
staying home, which allows them to visit anywhere.
  • Loading branch information
skizzerz committed Aug 31, 2024
1 parent 4bf59a9 commit 2f1d1ff
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/gamemodes/pactbreaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -600,8 +600,10 @@ def visit(self, wrapper: MessageDispatcher, message: str):
# 1. Everyone can stay home multiple nights in a row
# 2. Wolves can hunt in the forest multiple nights in a row
# 3. Vampires can hunt in the square multiple nights in a row
prev_location = self.prev_visiting.get(wrapper.source)

player_home = get_home(var, wrapper.source)
# default to home if n1 or they were in the stocks, to let them visit any location
prev_location = self.prev_visiting.get(wrapper.source, player_home)
player_role = get_main_role(var, wrapper.source)
prev_name = prev_location.name if prev_location in (Forest, VillageSquare) else "house"
target_name = target_location.name if target_location in (Forest, VillageSquare) else "house"
Expand Down

0 comments on commit 2f1d1ff

Please sign in to comment.