Fixed bug with removing shield without a reason

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@14312 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
deveee 2013-10-27 10:07:09 +00:00
parent 5824a2e942
commit 345f55d6f0

View File

@ -38,17 +38,18 @@ ExplosionAnimation *ExplosionAnimation::create(AbstractKart *kart,
bool direct_hit)
{
if(kart->isInvulnerable()) return NULL;
else if(kart->isShielded())
{
kart->decreaseShieldTime();
return NULL;
}
float r = kart->getKartProperties()->getExplosionRadius();
// Ignore explosion that are too far away.
if(!direct_hit && pos.distance2(kart->getXYZ())>r*r) return NULL;
if(kart->isShielded())
{
kart->decreaseShieldTime();
return NULL;
}
return new ExplosionAnimation(kart, pos, direct_hit);
} // create