Fix T39509: Crash when assign an empty as a LoD

Missing check when looking for appropriate LoD
This commit is contained in:
Daniel Stokes 2014-04-15 19:44:49 +00:00
parent 556590fa3a
commit 70f089b6f5
Notes: blender-bot 2023-02-14 10:52:11 +01:00
Referenced by issue #39509, Crash when assign an empty as a LoD
1 changed files with 1 additions and 1 deletions

View File

@ -759,7 +759,7 @@ void KX_GameObject::UpdateLod(MT_Vector3 &cam_pos)
Object *bob = this->GetBlenderObject();
LodLevel *lod = (LodLevel*) bob->lodlevels.first;
for (; lod; lod = lod->next, level++) {
if (!lod->source) level--;
if (!lod->source || lod->source->type != OB_MESH) level--;
if (!lod->next || lod->next->distance * lod->next->distance > distance2) break;
}