You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Improve error message when instantiating virtual class
This commit is contained in:
@@ -529,7 +529,7 @@ Object *ClassDB::instantiate(const StringName &p_class) {
|
|||||||
}
|
}
|
||||||
ERR_FAIL_COND_V_MSG(!ti, nullptr, "Cannot get class '" + String(p_class) + "'.");
|
ERR_FAIL_COND_V_MSG(!ti, nullptr, "Cannot get class '" + String(p_class) + "'.");
|
||||||
ERR_FAIL_COND_V_MSG(ti->disabled, nullptr, "Class '" + String(p_class) + "' is disabled.");
|
ERR_FAIL_COND_V_MSG(ti->disabled, nullptr, "Class '" + String(p_class) + "' is disabled.");
|
||||||
ERR_FAIL_COND_V(!ti->creation_func, nullptr);
|
ERR_FAIL_COND_V_MSG(!ti->creation_func, nullptr, "Class '" + String(p_class) + "' or its base class cannot be instantiated.");
|
||||||
}
|
}
|
||||||
#ifdef TOOLS_ENABLED
|
#ifdef TOOLS_ENABLED
|
||||||
if (ti->api == API_EDITOR && !Engine::get_singleton()->is_editor_hint()) {
|
if (ti->api == API_EDITOR && !Engine::get_singleton()->is_editor_hint()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user