@@ -292,6 +292,12 @@ class gz::sim::systems::AdvancedLiftDragPrivate
292
292
void AdvancedLiftDragPrivate::Load (const EntityComponentManager &_ecm,
293
293
const sdf::ElementPtr &_sdf)
294
294
{
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
+ }
295
301
this ->CL0 = _sdf->Get <double >(" CL0" , this ->CL0 ).first ;
296
302
this ->CD0 = _sdf->Get <double >(" CD0" , this ->CD0 ).first ;
297
303
this ->Cem0 = _sdf->Get <double >(" Cem0" , this ->Cem0 ).first ;
@@ -780,15 +786,9 @@ void AdvancedLiftDragPrivate::Update(EntityComponentManager &_ecm)
780
786
// ////////////////////////////////////////////////
781
787
void AdvancedLiftDrag::Configure (const Entity &_entity,
782
788
const std::shared_ptr<const sdf::Element> &_sdf,
783
- EntityComponentManager &_ecm , EventManager &)
789
+ EntityComponentManager &, EventManager &)
784
790
{
785
791
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
- }
792
792
this ->dataPtr ->sdfConfig = _sdf->Clone ();
793
793
}
794
794
0 commit comments