Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/inkle/ink
Browse files Browse the repository at this point in the history
  • Loading branch information
tomkail committed Aug 22, 2016
2 parents fbee47a + ea63335 commit 285d537
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions ink-engine-runtime/CallStack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public Element(PushPopType type, Container container, int contentIndex, bool inE
public Element Copy()
{
var copy = new Element (this.type, this.currentContainer, this.currentContentIndex, this.inExpressionEvaluation);
copy.temporaryVariables = this.temporaryVariables;
copy.temporaryVariables = new Dictionary<string,Object>(this.temporaryVariables);
return copy;
}
}
Expand Down Expand Up @@ -246,7 +246,7 @@ public void PopThread()
if (canPopThread) {
_threads.Remove (currentThread);
} else {
Debug.Fail ("Can't pop thread");
throw new System.Exception("Can't pop thread");
}
}

Expand Down Expand Up @@ -280,7 +280,7 @@ public void Pop(PushPopType? type = null)
callStack.RemoveAt (callStack.Count - 1);
return;
} else {
Debug.Fail ("Mismatched push/pop in Callstack");
throw new System.Exception("Mismatched push/pop in Callstack");
}
}

Expand Down
4 changes: 2 additions & 2 deletions ink-engine-runtime/Story.cs
Original file line number Diff line number Diff line change
Expand Up @@ -972,7 +972,7 @@ public bool HasFunction (string functionName)
{
try {
return ContentAtPath (new Path (functionName)) is Runtime.Container;
} catch (StoryException e) {
} catch {
return false;
}
}
Expand Down Expand Up @@ -1203,7 +1203,7 @@ object TryCoerce<T>(object value)
if (value == null)
return null;

if (value.GetType () == typeof(T))
if (value is T)
return (T) value;

if (value is float && typeof(T) == typeof(int)) {
Expand Down
4 changes: 2 additions & 2 deletions ink-engine-runtime/StoryState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,8 @@ internal StoryState Copy()
/// <summary>
/// Object representation of full JSON state. Usually you should use
/// LoadJson and ToJson since they serialise directly to string for you.
/// But, if your game uses Json.Net itself, it may be useful to get
/// the JToken so that you can integrate it into your own save format.
/// But it may be useful to get the object representation so that you
//// can integrate it into your own serialisation system.
/// </summary>
public Dictionary<string, object> jsonToken
{
Expand Down

0 comments on commit 285d537

Please sign in to comment.