diff --git a/lib/irrlicht/include/SMaterialLayer.h b/lib/irrlicht/include/SMaterialLayer.h index fd2397f60..a4d09988b 100644 --- a/lib/irrlicht/include/SMaterialLayer.h +++ b/lib/irrlicht/include/SMaterialLayer.h @@ -72,15 +72,8 @@ namespace video //! Destructor ~SMaterialLayer() { -#ifdef __APPLE__ - // Avoid a crash on osx, where one of the ReadOnlyMaterial - // Texture matrices is -1 - for atm unknown reasons - see #1938 - if(TextureMatrix != (core::matrix4*)0xffffffff) -#endif - { MatrixAllocator.destruct(TextureMatrix); MatrixAllocator.deallocate(TextureMatrix); - } } //! Assignment operator diff --git a/src/karts/kart_model.cpp b/src/karts/kart_model.cpp index 1928a66ab..7637c1b92 100644 --- a/src/karts/kart_model.cpp +++ b/src/karts/kart_model.cpp @@ -658,8 +658,11 @@ void KartModel::reset() // Stop any animations currently being played. setAnimation(KartModel::AF_DEFAULT); - // Don't force any LOD - ((LODNode*)m_kart->getNode())->forceLevelOfDetail(-1); + + // Don't force any LOD. Non-animated karts are not LOD nodes. + LODNode *lod = dynamic_cast(m_kart->getNode()); + if (lod) + lod->forceLevelOfDetail(-1); } // reset // ---------------------------------------------------------------------------- @@ -670,7 +673,9 @@ void KartModel::reset() void KartModel::finishedRace() { // Force the animated model, independent of actual camera distance. - ((LODNode*)m_kart->getNode())->forceLevelOfDetail(0); + LODNode *lod = dynamic_cast(m_kart->getNode()); + if (lod) + lod->forceLevelOfDetail(0); } // finishedRace // ----------------------------------------------------------------------------