Provide more context when scene fails to load
This commit is contained in:
parent
ac29e8e3fe
commit
c6c872ba34
1 changed files with 2 additions and 2 deletions
|
@ -138,7 +138,7 @@ Node *SceneState::instantiate(GenEditState p_edit_state) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
int nc = nodes.size();
|
int nc = nodes.size();
|
||||||
ERR_FAIL_COND_V(nc == 0, nullptr);
|
ERR_FAIL_COND_V_MSG(nc == 0, nullptr, vformat("Failed to instantiate scene state of \"%s\", node count is 0. Make sure the PackedScene resource is valid.", path));
|
||||||
|
|
||||||
const StringName *snames = nullptr;
|
const StringName *snames = nullptr;
|
||||||
int sname_count = names.size();
|
int sname_count = names.size();
|
||||||
|
@ -219,7 +219,7 @@ Node *SceneState::instantiate(GenEditState p_edit_state) const {
|
||||||
Ref<PackedScene> sdata = props[n.instance & FLAG_MASK];
|
Ref<PackedScene> sdata = props[n.instance & FLAG_MASK];
|
||||||
ERR_FAIL_COND_V(!sdata.is_valid(), nullptr);
|
ERR_FAIL_COND_V(!sdata.is_valid(), nullptr);
|
||||||
node = sdata->instantiate(p_edit_state == GEN_EDIT_STATE_DISABLED ? PackedScene::GEN_EDIT_STATE_DISABLED : PackedScene::GEN_EDIT_STATE_INSTANCE);
|
node = sdata->instantiate(p_edit_state == GEN_EDIT_STATE_DISABLED ? PackedScene::GEN_EDIT_STATE_DISABLED : PackedScene::GEN_EDIT_STATE_INSTANCE);
|
||||||
ERR_FAIL_NULL_V(node, nullptr);
|
ERR_FAIL_NULL_V_MSG(node, nullptr, vformat("Failed to load scene dependency: \"%s\". Make sure the required scene is valid.", sdata->get_path()));
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (n.type == TYPE_INSTANTIATED) {
|
} else if (n.type == TYPE_INSTANTIATED) {
|
||||||
|
|
Loading…
Reference in a new issue