Skip to content

Commit 0b881db

Browse files
Address #2920 the same way as #2907 addresses #2903 (#2923) (#2926)
(cherry picked from commit 4fa756b) Signed-off-by: Arjo Chakravarty <[email protected]> Co-authored-by: Arjo Chakravarty <[email protected]>
1 parent 7cc2fce commit 0b881db

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/systems/advanced_lift_drag/AdvancedLiftDrag.cc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,12 @@ class gz::sim::systems::AdvancedLiftDragPrivate
292292
void AdvancedLiftDragPrivate::Load(const EntityComponentManager &_ecm,
293293
const sdf::ElementPtr &_sdf)
294294
{
295+
if (!this->model.Valid(_ecm))
296+
{
297+
gzerr << "Advanced LiftDrag system should be attached to a model entity."
298+
<< "Failed to initialize." << std::endl;
299+
return;
300+
}
295301
this->CL0 = _sdf->Get<double>("CL0", this->CL0).first;
296302
this->CD0 = _sdf->Get<double>("CD0", this->CD0).first;
297303
this->Cem0 = _sdf->Get<double>("Cem0", this->Cem0).first;
@@ -780,15 +786,9 @@ void AdvancedLiftDragPrivate::Update(EntityComponentManager &_ecm)
780786
//////////////////////////////////////////////////
781787
void AdvancedLiftDrag::Configure(const Entity &_entity,
782788
const std::shared_ptr<const sdf::Element> &_sdf,
783-
EntityComponentManager &_ecm, EventManager &)
789+
EntityComponentManager &, EventManager &)
784790
{
785791
this->dataPtr->model = Model(_entity);
786-
if (!this->dataPtr->model.Valid(_ecm))
787-
{
788-
gzerr << "Advanced LiftDrag system should be attached to a model entity."
789-
<< "Failed to initialize." << std::endl;
790-
return;
791-
}
792792
this->dataPtr->sdfConfig = _sdf->Clone();
793793
}
794794

0 commit comments

Comments
 (0)