diff options
author | Juan Linietsky <reduzio@gmail.com> | 2016-02-21 11:52:11 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2016-02-21 11:52:11 -0300 |
commit | 499308e48265bea0cf92570c3e3b36dadf7c71d2 (patch) | |
tree | 2c600b6e6a351431386af625a1c6501e586e66ba /tools/editor/plugins | |
parent | b91b89cf60c31ec15c7f4f2ee51cc51e0e11c4ee (diff) |
-fixed a crash when closing scene with animationplayer open
-removed item checked print, closes #3564
Diffstat (limited to 'tools/editor/plugins')
-rw-r--r-- | tools/editor/plugins/animation_player_editor_plugin.cpp | 6 | ||||
-rw-r--r-- | tools/editor/plugins/script_editor_plugin.cpp | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/tools/editor/plugins/animation_player_editor_plugin.cpp b/tools/editor/plugins/animation_player_editor_plugin.cpp index fcb9f4db14..010753e88c 100644 --- a/tools/editor/plugins/animation_player_editor_plugin.cpp +++ b/tools/editor/plugins/animation_player_editor_plugin.cpp @@ -621,10 +621,11 @@ void AnimationPlayerEditor::ensure_visibility() { Dictionary AnimationPlayerEditor::get_state() const { + Dictionary d; d["visible"]=is_visible(); - if (is_visible() && player) { + if (EditorNode::get_singleton()->get_edited_scene() && is_visible() && player) { d["player"]=EditorNode::get_singleton()->get_edited_scene()->get_path_to(player); d["animation"]=player->get_current_animation(); @@ -637,6 +638,9 @@ void AnimationPlayerEditor::set_state(const Dictionary& p_state) { if (p_state.has("visible") && p_state["visible"]) { + if (!EditorNode::get_singleton()->get_edited_scene()) + return; + Node *n = EditorNode::get_singleton()->get_edited_scene()->get_node(p_state["player"]); if (n && n->cast_to<AnimationPlayer>()) { player=n->cast_to<AnimationPlayer>(); diff --git a/tools/editor/plugins/script_editor_plugin.cpp b/tools/editor/plugins/script_editor_plugin.cpp index 9c77230850..8d0527cff7 100644 --- a/tools/editor/plugins/script_editor_plugin.cpp +++ b/tools/editor/plugins/script_editor_plugin.cpp @@ -609,7 +609,7 @@ void ScriptEditor::_breaked(bool p_breaked,bool p_can_debug) { void ScriptEditor::_show_debugger(bool p_show) { - debug_menu->get_popup()->set_item_checked( debug_menu->get_popup()->get_item_index(DEBUG_SHOW), p_show); +// debug_menu->get_popup()->set_item_checked( debug_menu->get_popup()->get_item_index(DEBUG_SHOW), p_show); } void ScriptEditor::_script_created(Ref<Script> p_script) { |