diff --git a/src/systems/advanced_lift_drag/AdvancedLiftDrag.cc b/src/systems/advanced_lift_drag/AdvancedLiftDrag.cc index 80065691d5..c04bf8219d 100644 --- a/src/systems/advanced_lift_drag/AdvancedLiftDrag.cc +++ b/src/systems/advanced_lift_drag/AdvancedLiftDrag.cc @@ -292,6 +292,12 @@ class gz::sim::systems::AdvancedLiftDragPrivate void AdvancedLiftDragPrivate::Load(const EntityComponentManager &_ecm, const sdf::ElementPtr &_sdf) { + if (!this->model.Valid(_ecm)) + { + gzerr << "Advanced LiftDrag system should be attached to a model entity." + << "Failed to initialize." << std::endl; + return; + } this->CL0 = _sdf->Get("CL0", this->CL0).first; this->CD0 = _sdf->Get("CD0", this->CD0).first; this->Cem0 = _sdf->Get("Cem0", this->Cem0).first; @@ -780,15 +786,9 @@ void AdvancedLiftDragPrivate::Update(EntityComponentManager &_ecm) ////////////////////////////////////////////////// void AdvancedLiftDrag::Configure(const Entity &_entity, const std::shared_ptr &_sdf, - EntityComponentManager &_ecm, EventManager &) + EntityComponentManager &, EventManager &) { this->dataPtr->model = Model(_entity); - if (!this->dataPtr->model.Valid(_ecm)) - { - gzerr << "Advanced LiftDrag system should be attached to a model entity." - << "Failed to initialize." << std::endl; - return; - } this->dataPtr->sdfConfig = _sdf->Clone(); }