Fix checking for void and table's toGodot

This commit is contained in:
Ruslan Mustakov 2017-07-27 11:06:26 +07:00
commit 94f6f7c8a7
3 changed files with 4 additions and 3 deletions

View file

@ -1,4 +1,4 @@
version = "0.2.3"
version = "0.2.4"
author = "Xored Software, Inc."
description = "Godot Engine bindings"
license = "MIT"

View file

@ -473,7 +473,8 @@ proc genType(obj: ObjectDecl): NimNode {.compileTime.} =
else: toGodotStyle(meth.name)
let hasReturnValueBool = not (meth.returnType.isNil or
meth.returnType.kind == nnkEmpty or
$meth.returnType == "void")
(meth.returnType.kind == nnkIdent and
meth.returnType.ident == !"void"))
let hasReturnValue = if hasReturnValueBool: ident("true")
else: ident("false")
result.add(getAst(

View file

@ -493,7 +493,7 @@ proc godotVariantType*(T: typedesc[Table|TableRef]): VariantType {.inline.} =
VariantType.Dictionary
proc toGodot*[T: Table or TableRef](t: T): Variant =
let dict = initDictionary()
var dict = initDictionary()
mixin toGodot
for k, v in t.pairs():
dict[toGodot(k)] = toGodot(v)