From 75d66ef040af7772e344103ffd0eb16d6e0ad29a Mon Sep 17 00:00:00 2001 From: fourthoneout Date: Thu, 16 Dec 2021 14:49:31 +0900 Subject: [PATCH] Fix Evil Guesser cannot guess Add null check to avoid for NullReferenceException in `Guesser.remainingShots`. Fix #264 --- TheOtherRoles/TheOtherRoles.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TheOtherRoles/TheOtherRoles.cs b/TheOtherRoles/TheOtherRoles.cs index 320fde3..8bb2a28 100644 --- a/TheOtherRoles/TheOtherRoles.cs +++ b/TheOtherRoles/TheOtherRoles.cs @@ -1031,7 +1031,7 @@ namespace TheOtherRoles public static int remainingShots(byte playerId, bool shoot = false) { int remainingShots = remainingShotsEvilGuesser; - if (niceGuesser.PlayerId == playerId) { + if (niceGuesser != null && niceGuesser.PlayerId == playerId) { remainingShots = remainingShotsNiceGuesser; if (shoot) remainingShotsNiceGuesser = Mathf.Max(0, remainingShotsNiceGuesser - 1); } else if (shoot) { -- 2.39.5