Avoid bounce karts from edges in soccer field.

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@14428 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
deveee 2013-11-14 19:03:35 +00:00
parent 59f2e7ff75
commit ea2b34c52e
3 changed files with 7 additions and 2 deletions

View File

@ -458,6 +458,10 @@ Material::Material(const XMLNode *node, int index, bool deprecated)
{
m_collision_reaction = PUSH_BACK;
}
else if (creaction == "push-soccer")
{
m_collision_reaction = PUSH_SOCCER_BALL;
}
else if (creaction.size() > 0)
{
fprintf(stderr, "[Material] WARNING: Unknown collision reaction '%s'\n", creaction.c_str());

View File

@ -73,7 +73,8 @@ public:
{
NORMAL,
RESCUE,
PUSH_BACK
PUSH_BACK,
PUSH_SOCCER_BALL
};
private:

View File

@ -544,7 +544,7 @@ bool PhysicalObject::isSoccerBall() const
*/
void PhysicalObject::hit(const Material *m, const Vec3 &normal)
{
if(isSoccerBall() && m->getCollisionReaction() == Material::PUSH_BACK)
if(isSoccerBall() && m->getCollisionReaction() == Material::PUSH_SOCCER_BALL)
{
m_body->applyCentralImpulse(normal * 1000.0f);
}