Handle nil in ==
This commit is contained in:
parent
8ef554501f
commit
4cc9711d2f
1 changed files with 3 additions and 1 deletions
|
|
@ -420,7 +420,9 @@ proc removeGodotObject*(nimObj: NimGodotObject) {.inline.} =
|
||||||
|
|
||||||
proc `==`*(self, other: NimGodotObject): bool {.inline.} =
|
proc `==`*(self, other: NimGodotObject): bool {.inline.} =
|
||||||
## Compares objects by referential equality.
|
## Compares objects by referential equality.
|
||||||
self.godotObject == other.godotObject
|
if self.isNil and other.isNil: return true
|
||||||
|
if self.isNil != other.isNil: return false
|
||||||
|
result = (self.godotObject == other.godotObject)
|
||||||
|
|
||||||
proc godotObject*(nimObj: NimGodotObject): ptr GodotObject {.inline.} =
|
proc godotObject*(nimObj: NimGodotObject): ptr GodotObject {.inline.} =
|
||||||
## Returns raw poitner to ``GodotObject``. Use only if you know what
|
## Returns raw poitner to ``GodotObject``. Use only if you know what
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue