From adde89e8b1c66b4f4814c3b47a5d347ff576428b Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sun, 3 Sep 2017 14:53:17 -0300 Subject: -Added an optimization so physics shapes are configured later, speeds up grid map loading and editing --- editor/plugins/script_editor_plugin.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'editor/plugins/script_editor_plugin.cpp') diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index a529f152d..10a72ca5b 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -972,6 +972,14 @@ void ScriptEditor::_menu_option(int p_option) { EditorNode::get_singleton()->show_warning("Can't obtain the script for running"); break; } + + current->apply_code(); + Error err = scr->reload(false); //hard reload script before running always + + if (err != OK) { + EditorNode::get_singleton()->show_warning("Script failed reloading, check console for errors."); + return; + } if (!scr->is_tool()) { EditorNode::get_singleton()->show_warning("Script is not in tool mode, will not be able to run"); -- cgit v1.2.3-70-g09d2