Avoid crash when object doesn't have texture
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@14430 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
ea2b34c52e
commit
ac2981584e
@ -544,7 +544,8 @@ bool PhysicalObject::isSoccerBall() const
|
||||
*/
|
||||
void PhysicalObject::hit(const Material *m, const Vec3 &normal)
|
||||
{
|
||||
if(isSoccerBall() && m->getCollisionReaction() == Material::PUSH_SOCCER_BALL)
|
||||
if(isSoccerBall() && m != NULL &&
|
||||
m->getCollisionReaction() == Material::PUSH_SOCCER_BALL)
|
||||
{
|
||||
m_body->applyCentralImpulse(normal * 1000.0f);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user