From 66488b213e4ae3693e19a4f27a32faf6bb84172b Mon Sep 17 00:00:00 2001 From: Yannick Lohse Date: Wed, 21 Sep 2016 21:32:28 +0200 Subject: [PATCH] Fixed bugs with random --- engine/Story.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/engine/Story.js b/engine/Story.js index 82f7170f..097af877 100644 --- a/engine/Story.js +++ b/engine/Story.js @@ -724,7 +724,7 @@ export class Story extends InkObject{ var resultSeed = this.state.storySeed + this.state.previousRandom; var random = new PRNG(resultSeed); - var nextRandom = random.Next(); + var nextRandom = random.next(); var chosenValue = (nextRandom % randomRange) + minInt.value; this.state.PushEvaluationStack(new IntValue(chosenValue)); @@ -742,7 +742,7 @@ export class Story extends InkObject{ this.state.previousRandom = 0; // SEED_RANDOM returns nothing. - this.state.PushEvaluationStack(new Runtime.Void()); + this.state.PushEvaluationStack(new Void()); break; case ControlCommand.CommandType.VisitIndex: @@ -893,6 +893,7 @@ export class Story extends InkObject{ try { funcContainer = this.ContentAtPath(new Path(functionName)); } catch (e) { + console.log(e); if (e.message.indexOf("not found") >= 0) throw "Function doesn't exist: '" + functionName + "'"; else