Check for valid value when updating AI lod radius.
This commit is contained in:
parent
35c24ce5d4
commit
c6e91d8751
1 changed files with 8 additions and 2 deletions
|
@ -297,8 +297,14 @@ void FGAIBase::update(double dt) {
|
|||
_modeldata->init();
|
||||
|
||||
// update LOD radius from loaded modeldata
|
||||
_model->setRadius(_modeldata->getRadius());
|
||||
_model->dirtyBound();
|
||||
auto radius = _modeldata->getRadius();
|
||||
if (radius > 0) {
|
||||
_model->setRadius(radius);
|
||||
_model->dirtyBound();
|
||||
}
|
||||
else {
|
||||
SG_LOG(SG_AI, SG_WARN, "AIBase: model radius not set.");
|
||||
}
|
||||
|
||||
// sound initialization
|
||||
if (fgGetBool("/sim/sound/aimodels/enabled",false))
|
||||
|
|
Loading…
Add table
Reference in a new issue