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:
parent
5824a2e942
commit
345f55d6f0
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user