summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorhbina085 <hanif.ariffin.4326@gmail.com>2019-05-22 16:38:14 -0400
committerhbina085 <hanif.ariffin.4326@gmail.com>2019-05-24 07:32:27 -0400
commite1816ee0cb64edf3e9929edd9142ccbe7d2105e0 (patch)
treeb56344542bd9b0cac42cbf4adedc8d6f9f3d1bf8 /editor
parentfa5cc1da7a83ca7bdf685ba243e207bcd5de7370 (diff)
fixed problem where the script lists gets ordered even when ordering is disabled
Diffstat (limited to 'editor')
-rw-r--r--editor/plugins/script_editor_plugin.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp
index 828abef9a9..38985a2b2c 100644
--- a/editor/plugins/script_editor_plugin.cpp
+++ b/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;
+ }
}
};