1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-10 13:00:37 +00:00

Fix crash when dropping scene as a sibling of the root node

This commit is contained in:
Franklin Sobrinho
2016-07-18 15:00:14 -03:00
parent c328693e83
commit 2a97d79a64
2 changed files with 14 additions and 15 deletions

View File

@@ -983,6 +983,14 @@ bool SceneTreeEditor::can_drop_data_fw(const Point2& p_point,const Variant& p_da
if (!d.has("type"))
return false;
TreeItem *item = tree->get_item_at_pos(p_point);
if (!item)
return false;
int section = tree->get_drop_section_at_pos(p_point);
if (section<-1 || (section==-1 && !item->get_parent()))
return false;
if (String(d["type"])=="files") {
Vector<String> files = d["files"];
@@ -1005,15 +1013,7 @@ bool SceneTreeEditor::can_drop_data_fw(const Point2& p_point,const Variant& p_da
if (String(d["type"])=="nodes") {
TreeItem *item = tree->get_item_at_pos(p_point);
if (!item)
return false;
int section = tree->get_drop_section_at_pos(p_point);
if (section<-1 || (section==-1 && !item->get_parent()))
return false;
return true;
}
return false;