Don't swat invincible karts
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@9965 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
2a227e9d8b
commit
24ed5f15cc
@ -267,8 +267,12 @@ void Swatter::squashThingsAround()
|
||||
{
|
||||
Kart *kart = world->getKart(i);
|
||||
// TODO: isSwatterReady()
|
||||
if(kart->isEliminated() || kart==m_kart || kart->isSquashed())
|
||||
if(kart->isEliminated() || kart==m_kart)
|
||||
continue;
|
||||
// don't swat an already hurt kart
|
||||
if (kart->isInvulnerable() || kart->isSquashed())
|
||||
continue;
|
||||
|
||||
float dist2 = (kart->getXYZ()-swatter_pos).length2();
|
||||
|
||||
if(dist2 >= min_dist2) continue; // too far away, ignore this kart
|
||||
|
@ -1031,6 +1031,8 @@ void Kart::showZipperFire()
|
||||
*/
|
||||
void Kart::setSquash(float time, float slowdown)
|
||||
{
|
||||
if (isInvulnerable()) return;
|
||||
|
||||
if(m_attachment->getType()==Attachment::ATTACH_BOMB)
|
||||
{
|
||||
this->handleExplosion(getXYZ(), /*direct hit*/true);
|
||||
|
Loading…
Reference in New Issue
Block a user