summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorsheepandshepherd <sheepandshepherd@hotmail.com>2018-04-10 16:01:13 +0200
committersheepandshepherd <sheepandshepherd@hotmail.com>2018-04-11 09:43:07 +0200
commitbc110b37713dc41ec6b364f3d31eaf2b369e06bb (patch)
tree9274ab4ee5fd81887d050fb7a05e93a14c692857 /modules
parent48890b15c5b5ff54ea2cf416a9d3157f2d5dee5b (diff)
Fix NativeScript property list
Diffstat (limited to 'modules')
-rw-r--r--modules/gdnative/nativescript/nativescript.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/modules/gdnative/nativescript/nativescript.cpp b/modules/gdnative/nativescript/nativescript.cpp
index d255148e0f..cf8977f3ea 100644
--- a/modules/gdnative/nativescript/nativescript.cpp
+++ b/modules/gdnative/nativescript/nativescript.cpp
@@ -357,14 +357,13 @@ void NativeScript::get_script_property_list(List<PropertyInfo> *p_list) const {
NativeScriptDesc *script_data = get_script_desc();
Set<StringName> existing_properties;
+ List<PropertyInfo>::Element *original_back = p_list->back();
while (script_data) {
- List<PropertyInfo>::Element *insert_position = p_list->front();
- bool insert_before = true;
+ List<PropertyInfo>::Element *insert_position = original_back;
for (OrderedHashMap<StringName, NativeScriptDesc::Property>::Element E = script_data->properties.front(); E; E = E.next()) {
if (!existing_properties.has(E.key())) {
- insert_position = insert_before ? p_list->insert_before(insert_position, E.get().info) : p_list->insert_after(insert_position, E.get().info);
- insert_before = false;
+ insert_position = p_list->insert_after(insert_position, E.get().info);
existing_properties.insert(E.key());
}
}