diff options
author | Porteries Tristan <republicthunderbolt9@gmail.com> | 2015-07-02 13:20:13 +0300 |
---|---|---|
committer | Porteries Tristan <republicthunderbolt9@gmail.com> | 2015-07-02 13:27:14 +0300 |
commit | e61ead7d4c0a0067fb55f6abb68f637a8fd21d1f (patch) | |
tree | c6daa68147db6e581aeec4f919bb2337f9fe6d07 | |
parent | db8ccc18f7bfc97e8cd599cb42ce70e83f89d493 (diff) |
BGE: Fix T45267 Lib load without material caching.
-rw-r--r-- | source/gameengine/Converter/KX_BlenderSceneConverter.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp index 28de61f0e04..253646a8a0e 100644 --- a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp +++ b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp @@ -1361,14 +1361,18 @@ bool KX_BlenderSceneConverter::MergeScene(KX_Scene *to, KX_Scene *from) } MaterialCache::iterator matcacheit = m_mat_cache.find(from); - // Merge cached BL_Material map. - m_mat_cache[to].insert(matcacheit->second.begin(), matcacheit->second.end()); - m_mat_cache.erase(matcacheit); + if (matcacheit != m_mat_cache.end()) { + // Merge cached BL_Material map. + m_mat_cache[to].insert(matcacheit->second.begin(), matcacheit->second.end()); + m_mat_cache.erase(matcacheit); + } PolyMaterialCache::iterator polymatcacheit = m_polymat_cache.find(from); - // Merge cached RAS_IPolyMaterial map. - m_polymat_cache[to].insert(polymatcacheit->second.begin(), polymatcacheit->second.end()); - m_polymat_cache.erase(polymatcacheit); + if (polymatcacheit != m_polymat_cache.end()) { + // Merge cached RAS_IPolyMaterial map. + m_polymat_cache[to].insert(polymatcacheit->second.begin(), polymatcacheit->second.end()); + m_polymat_cache.erase(polymatcacheit); + } return true; } |