diff options
| author | Juan Linietsky | 2016-01-13 09:42:03 -0300 |
|---|---|---|
| committer | Juan Linietsky | 2016-01-13 09:42:03 -0300 |
| commit | c633a29a391c8797ace9ebb838390b318e8c91a9 (patch) | |
| tree | 886323bfda93d1b9fd63aa378279282f73da3b30 /main/main.cpp | |
| parent | 96317566c254223ab8a2055ee4e5bf22690e0072 (diff) | |
| download | godot-c633a29.tar.gz godot-c633a29.tar.zst godot-c633a29.zip | |
improve reporting of error in wrong inheritance for autoload script
Diffstat (limited to 'main/main.cpp')
| -rw-r--r-- | main/main.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/main/main.cpp b/main/main.cpp index 8736166b6..f9bf40672 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -1374,12 +1374,13 @@ bool Main::start() { } else if (res->is_type("Script")) { Ref<Script> s = res; StringName ibt = s->get_instance_base_type(); + bool valid_type = !ObjectTypeDB::is_type(ibt,"Node"); ERR_EXPLAIN("Script does not inherit a Node: "+path); - ERR_CONTINUE( !ObjectTypeDB::is_type(ibt,"Node") ); + ERR_CONTINUE( !valid_type ); Object *obj = ObjectTypeDB::instance(ibt); - ERR_EXPLAIN("Cannot instance node for autoload type: "+String(ibt)); + ERR_EXPLAIN("Cannot instance script for autoload, expected 'Node' inheritance, got: "+String(ibt)); ERR_CONTINUE( obj==NULL ); n = obj->cast_to<Node>(); |
