From: fourthoneout Date: Thu, 16 Dec 2021 05:49:31 +0000 (+0900) Subject: Fix Evil Guesser cannot guess X-Git-Url: https://git.deb.at/?a=commitdiff_plain;h=75d66ef040af7772e344103ffd0eb16d6e0ad29a;p=rhonda%2Ftheotherroles.git Fix Evil Guesser cannot guess Add null check to avoid for NullReferenceException in `Guesser.remainingShots`. Fix #264 --- 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) {