summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-10-15 09:54:58 +0200
committerGitHub <noreply@github.com>2019-10-15 09:54:58 +0200
commit44293db4462f551617147b85e2ede66acf741c55 (patch)
treea759d0146077ef7e6d390884ae18578ad8411e73 /editor
parent48d3458f74ee3a5c0596c905b72b52af612cde87 (diff)
parent616ab4fac200170bc0d2ba1958e424fd309fc494 (diff)
Merge pull request #32820 from qarmin/small_fixes_static_analyzer
Small fixes to redundand code, copy paste bugs
Diffstat (limited to 'editor')
-rw-r--r--editor/import/editor_scene_importer_gltf.cpp2
-rw-r--r--editor/plugins/canvas_item_editor_plugin.cpp4
-rw-r--r--editor/project_settings_editor.cpp2
3 files changed, 5 insertions, 3 deletions
diff --git a/editor/import/editor_scene_importer_gltf.cpp b/editor/import/editor_scene_importer_gltf.cpp
index 49091dc812..fcf0e4af6f 100644
--- a/editor/import/editor_scene_importer_gltf.cpp
+++ b/editor/import/editor_scene_importer_gltf.cpp
@@ -1973,7 +1973,7 @@ Error EditorSceneImporterGLTF::_reparent_to_fake_joint(GLTFState &state, GLTFSke
state.nodes.push_back(fake_joint);
// We better not be a joint, or we messed up in our logic
- if (node->joint == true)
+ if (node->joint)
return FAILED;
fake_joint->translation = node->translation;
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp
index 117b88bc7e..2a31d53a7e 100644
--- a/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/editor/plugins/canvas_item_editor_plugin.cpp
@@ -1197,7 +1197,7 @@ bool CanvasItemEditor::_gui_input_zoom_or_pan(const Ref<InputEvent> &p_event, bo
//Pan the viewport
panning = true;
}
- } else if (panning) {
+ } else {
if (!k->is_pressed()) {
// Stop panning the viewport (for any mouse button press)
panning = false;
@@ -4894,7 +4894,7 @@ void CanvasItemEditor::set_state(const Dictionary &p_state) {
if (state.has("grid_snap_active")) {
grid_snap_active = state["grid_snap_active"];
- grid_snap_button->set_pressed(smart_snap_active);
+ grid_snap_button->set_pressed(grid_snap_active);
}
if (state.has("snap_node_parent")) {
diff --git a/editor/project_settings_editor.cpp b/editor/project_settings_editor.cpp
index 35187214a6..803c806028 100644
--- a/editor/project_settings_editor.cpp
+++ b/editor/project_settings_editor.cpp
@@ -1109,6 +1109,8 @@ void ProjectSettingsEditor::drop_data_fw(const Point2 &p_point, const Variant &p
TreeItem *selected = input_editor->get_selected();
TreeItem *item = input_editor->get_item_at_position(p_point);
+ if (!item)
+ return;
TreeItem *target = item->get_parent() == input_editor->get_root() ? item : item->get_parent();
String selected_name = "input/" + selected->get_text(0);