Skip to content

Commit

Permalink
More obvious fix for #17
Browse files Browse the repository at this point in the history
  • Loading branch information
y-lohse committed Jul 4, 2016
1 parent a425309 commit 010cf85
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions engine/Story.js
Original file line number Diff line number Diff line change
Expand Up @@ -638,9 +638,6 @@ export class Story extends InkObject{

case ControlCommand.CommandType.EndString:

// Since we're iterating backward through the content,
// build a stack so that when we build the string,
// it's in the right order
var contentStackForString = [];

var outputCountConsumed = 0;
Expand All @@ -662,9 +659,12 @@ export class Story extends InkObject{
// Consume the content that was produced for this string
this.state.outputStream.splice(this.state.outputStream.length - outputCountConsumed, outputCountConsumed);

//the C# version uses a Stack for contentStackForString, but we're using a simple array, so we need to reverse it before using it
contentStackForString = contentStackForString.reverse();

// Build string out of the content we collected
var sb = '';
contentStackForString.reverse().forEach(c => {
contentStackForString.forEach(c => {
sb += c.toString();
});

Expand Down

0 comments on commit 010cf85

Please sign in to comment.