From 0694ed96fbe33d66b0691d13c2e317652e68b0ab Mon Sep 17 00:00:00 2001 From: Solirs Date: Tue, 27 Jun 2023 23:09:54 +0200 Subject: [PATCH] Make sure dead players cant do actions --- freefang/roles.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/freefang/roles.py b/freefang/roles.py index aec9228..8755fa0 100644 --- a/freefang/roles.py +++ b/freefang/roles.py @@ -88,7 +88,7 @@ def vote(headers, game, connection): target = game.getplayerbyname(headers.target) - if game.up == Werewolf and headers.sender.iswerewolf() and headers.sender.voted == False and target.alive: + if game.up == Werewolf and headers.sender.iswerewolf() and headers.sender.voted == False and target.alive and headers.sender.alive: if target == headers.sender.protected: return 3 # protected player case (3) vt = WerewolfVote(headers.target, headers.sender) @@ -128,7 +128,7 @@ class Seer: def reveal(headers, game, connection): target = game.getplayerbyname(headers.target) # Check if the player is actually a seer, if the role currently woken up is seer, and if the target is alive - if game.up == Seer and headers.sender.role == Seer and target.alive: + if game.up == Seer and headers.sender.role == Seer and target.alive and headers.sender.alive: # Create packet packet = packets.SeerReveal(target.role.__name__, target.name) # Send packet containing the desired info to the seer