Browse Source

fixed problem where the script lists gets ordered even when ordering is disabled

hbina085 6 years ago
parent
commit
e1816ee0cb
1 changed files with 9 additions and 1 deletions
  1. 9 1
      editor/plugins/script_editor_plugin.cpp

+ 9 - 1
editor/plugins/script_editor_plugin.cpp

@@ -1558,7 +1558,15 @@ struct _ScriptEditorItemData {
 
 	bool operator<(const _ScriptEditorItemData &id) const {
 
-		return category == id.category ? sort_key < id.sort_key : category < id.category;
+		if (category == id.category) {
+			if (sort_key == id.sort_key) {
+				return index < id.index;
+			} else {
+				return sort_key < id.sort_key;
+			}
+		} else {
+			return category < id.category;
+		}
 	}
 };