heroiclabs / nakama-godot

Godot client for Nakama server written in GDScript.
Apache License 2.0
593 stars 69 forks source link

Incorrect way of type checking. #164

Closed INdIEDeV016 closed 1 year ago

INdIEDeV016 commented 1 year ago

Checking the type of the object in this way is not supported in Godot 4 as it errors out with "Could not find type "p_type" in the current scope.", since Godot is considering the parameter p_type as a pre-defined or defined name of a class such as Node, Object, GDScript, etc.

Therefore, we can check the type of p_obj by getting the class as string and seeing if it is equal to base type of p_type.

dsnopek commented 1 year ago

Thanks!

However, I ended up going with PR #157 which uses is_instance_of() rather than comparing the class name strings.