Skip to content

Commit

Permalink
Added null check to condition checks
Browse files Browse the repository at this point in the history
  • Loading branch information
ben_pollard committed Jan 19, 2024
1 parent 09c373f commit 05ed1bb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions BP.AdventureFramework/Logic/Game.cs
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,8 @@ private void Execute()
do
{
var displayReactionToInput = true;
var endCheckResult = CompletionCondition(this);
var gameOverCheckResult = GameOverCondition(this);
var endCheckResult = CompletionCondition(this) ?? EndCheckResult.NotEnded;
var gameOverCheckResult = GameOverCondition(this) ?? EndCheckResult.NotEnded;

if (endCheckResult.HasEnded)
{
Expand All @@ -259,8 +259,8 @@ private void Execute()
if (!CurrentFrame.AcceptsInput)
{
var frame = CurrentFrame;

while (!WaitForKeyPressCallback(Convert.ToChar(13)) && CurrentFrame == frame)
while (!WaitForKeyPressCallback(StringUtilities.CR) && CurrentFrame == frame)
DrawFrame(CurrentFrame);
}
else
Expand Down

0 comments on commit 05ed1bb

Please sign in to comment.