diff --git a/src/Engine/Editor/EditorGUI.cpp b/src/Engine/Editor/EditorGUI.cpp index 0d747b86..01f15da9 100644 --- a/src/Engine/Editor/EditorGUI.cpp +++ b/src/Engine/Editor/EditorGUI.cpp @@ -285,9 +285,8 @@ bool EditorGUI::drawComponentNode(EntityWrapper entity, const ComponentInfo& ci) // Draw component fields ComponentWrapper& component = entity.World->GetComponent(entity.ID, ci.Name); - for (auto& kv : ci.Fields) { - const std::string& fieldName = kv.first; - const ComponentInfo::Field_t& field = kv.second; + for (auto& fieldName : ci.FieldsInOrder) { + const ComponentInfo::Field_t& field = ci.Fields.at(fieldName); // Draw the field widget based on its type bool dirty = drawComponentField(component, field);