1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-28 16:07:14 +00:00

Merge pull request #18011 from karroffel/nativescript-more-type-tag-fixes

[NativeScript] replace error macros by simple returns
This commit is contained in:
Rémi Verschelde
2018-04-06 07:55:50 +02:00
committed by GitHub

View File

@@ -339,13 +339,11 @@ const void GDAPI *godot_nativescript_get_type_tag(const godot_object *p_object)
const Object *o = (Object *)p_object; const Object *o = (Object *)p_object;
if (!o->get_script_instance()) { if (!o->get_script_instance()) {
ERR_EXPLAIN("Attempted to get type tag on an object without a script!"); return NULL;
ERR_FAIL_V(NULL);
} else { } else {
NativeScript *script = Object::cast_to<NativeScript>(o->get_script_instance()->get_script().ptr()); NativeScript *script = Object::cast_to<NativeScript>(o->get_script_instance()->get_script().ptr());
if (!script) { if (!script) {
ERR_EXPLAIN("Attempted to get type tag on an object without a nativescript attached"); return NULL;
ERR_FAIL_V(NULL);
} }
if (script->get_script_desc()) if (script->get_script_desc())