Skip to content

Commit

Permalink
Fix two bugs related to the witch
Browse files Browse the repository at this point in the history
  • Loading branch information
Solirs committed Jul 3, 2023
1 parent 7d0ec90 commit 59f3275
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions freefang/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,15 @@ def kill_player(self, player, reason=None):
if player.protected:
return 1
print(player.name + " died")
player.alive = False


# If the player died during the night we keep it in a list to notify the other players when the day rises
# Otherwise we just send the packet right away
if self.up != 0 and self.up != Hunter:
self.nightdeaths.append(player)
return 0

player.alive = False


# Notify everyone that player died
event = packets.Player_death(name=player.name, role=player.role.__name__, reason=reason)
Expand Down
3 changes: 2 additions & 1 deletion freefang/roles.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ def revive(headers, game, connection):
return 1
@staticmethod
def onwakeup(game):
event = utils.obj_to_json(packets.Witch_send_dead(game.nightdeaths))
dead = [i.name for i in game.nightdeaths]
event = utils.obj_to_json(packets.Witch_send_dead(dead))
game.sendrole(event, Witch)

class Vote:
Expand Down

0 comments on commit 59f3275

Please sign in to comment.