BGE: Add missing NULL check from recent LOD updates
authorCampbell Barton <ideasman42@gmail.com>
Wed, 25 Dec 2013 21:28:00 +0000 (08:28 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 25 Dec 2013 21:28:00 +0000 (08:28 +1100)
source/gameengine/Converter/BL_BlenderDataConversion.cpp

index a1e4f9f22aee0211acba15eebc38287f5ba6ea1e..a7d6fcbc0ed75347d232a36968e3830a505ffb5b 100644 (file)
@@ -942,10 +942,11 @@ RAS_MeshObject* BL_ConvertMesh(Mesh* mesh, Object* blenderobj, KX_Scene* scene,
        // Without checking names, we get some reuse we don't want that can cause
        // problems with material LoDs.
        if ((meshobj = converter->FindGameMesh(mesh/*, ob->lay*/)) != NULL) {
-               STR_String bge_name = meshobj->GetName();
-               STR_String blender_name = ((Mesh*)blenderobj->data)->id.name+2;
-               if (bge_name == blender_name)
+               const char *bge_name = meshobj->GetName().ReadPtr();
+               const char *blender_name = ((ID *)blenderobj->data)->name + 2;
+               if (STREQ(bge_name, blender_name)) {
                        return meshobj;
+               }
        }
 
        // Get DerivedMesh data