1
0
Fork 0

Check for valid value when updating AI lod radius.

This commit is contained in:
Dan Wickstrom 2019-05-18 11:30:37 -04:00
parent 35c24ce5d4
commit c6e91d8751

View file

@ -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))