[Bf-blender-cvs] [70f089b] master: Fix T39509: Crash when assign an empty as a LoD

Daniel Stokes noreply at git.blender.org
Wed Apr 16 05:07:17 CEST 2014


Commit: 70f089b6f5b768b7ee0d6bc98d64a202e99fc22f
Author: Daniel Stokes
Date:   Tue Apr 15 19:44:49 2014 +0000
https://developer.blender.org/rB70f089b6f5b768b7ee0d6bc98d64a202e99fc22f

Fix T39509: Crash when assign an empty as a LoD

Missing check when looking for appropriate LoD

===================================================================

M	source/gameengine/Ketsji/KX_GameObject.cpp

===================================================================

diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp
index f1f12ca..ec64d09 100644
--- a/source/gameengine/Ketsji/KX_GameObject.cpp
+++ b/source/gameengine/Ketsji/KX_GameObject.cpp
@@ -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;
 	}




More information about the Bf-blender-cvs mailing list