diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-05-27 19:13:14 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-05-27 19:13:14 +0400 |
commit | 880c132b11829abce6b6a935437278cc70034c3c (patch) | |
tree | a0c05afb04818ada1a1cc0a15299d9a727bdcf67 | |
parent | 5a96c739c1f255effa2ef16e39afcd8a4fdd3b8e (diff) |
Fix #35480: object without material crash blender when starting game engine
Was a missing NULL-pointer check. No idea why it took so long to figure
issue out -- apparently there was no crash in linux for me and msvc
didn't show any backtrace :S
Also corrected weirdo way of bit flag check which was:
!ma->mode & MA_FACETEXTURE
better do !(ma->mode & MA_FACETEXTURE) since ! is a logic NOT.
-rw-r--r-- | source/gameengine/Converter/BL_BlenderDataConversion.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp index ebe35369844..2fb83d4c1fd 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp +++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp @@ -905,7 +905,7 @@ static RAS_MaterialBucket *material_from_mesh(Material *ma, MFace *mface, MTFace ConvertMaterial(bl_mat, ma, tface, tfaceName, mface, mcol, converter->GetGLSLMaterials()); - if ((!ma->mode & MA_FACETEXTURE)) + if (ma && (ma->mode & MA_FACETEXTURE) == 0) converter->CacheBlenderMaterial(ma, bl_mat); } @@ -921,7 +921,7 @@ static RAS_MaterialBucket *material_from_mesh(Material *ma, MFace *mface, MTFace kx_blmat->Initialize(scene, bl_mat, (ma?&ma->game:NULL), lightlayer); polymat = static_cast<RAS_IPolyMaterial*>(kx_blmat); - if ((!ma->mode & MA_FACETEXTURE)) + if (ma && (ma->mode & MA_FACETEXTURE) == 0) converter->CachePolyMaterial(ma, polymat); } } |