Skip to content

Commit

Permalink
A call to -> END resets the state of "previousContentObject", which a…
Browse files Browse the repository at this point in the history
…ffects which containers get updated with visit counts and turn indices. Exposed ForceEnd() to allow the C# runtime to make this call if necessary.
  • Loading branch information
joethephish committed Sep 9, 2016
1 parent 343f638 commit b822360
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions ink-engine-runtime/Story.cs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public void ResetErrors()
/// </summary>
public void ResetCallstack()
{
_state.ForceEndFlow ();
_state.ForceEnd ();
}

void ResetGlobals()
Expand Down Expand Up @@ -844,7 +844,7 @@ bool PerformLogicAndFlowControl(Runtime.Object contentObj)

// Force flow to end completely
case ControlCommand.CommandType.End:
state.ForceEndFlow ();
state.ForceEnd ();
break;

default:
Expand Down Expand Up @@ -1771,7 +1771,7 @@ void AddError (string message, bool useEndLineNumber)
state.AddError (message);

// In a broken state don't need to know about any other errors.
state.ForceEndFlow ();
state.ForceEnd ();
}

void Assert(bool condition, string message = null, params object[] formatParams)
Expand Down
4 changes: 3 additions & 1 deletion ink-engine-runtime/StoryState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ internal Runtime.Object PeekEvaluationStack()
}


internal void ForceEndFlow()
public void ForceEnd()
{
currentContentObject = null;

Expand All @@ -684,6 +684,8 @@ internal void ForceEndFlow()

currentChoices.Clear();

previousContentObject = null;

didSafeExit = true;
}

Expand Down

0 comments on commit b822360

Please sign in to comment.