Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 4, 2011, 2:14:25 PM (14 years ago)
Author:
simonmie
Message:

Added countdown time before shield reload starts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/gameimmersion/src/modules/weapons/projectiles/Projectile.cc

    r8152 r8183  
    9494    }
    9595
     96//////////////////////////me edit
    9697    bool Projectile::collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint)
    9798    {
     
    103104            this->bDestroy_ = true;
    104105
    105             Pawn* victim = orxonox_cast<Pawn*>(otherObject);
     106            Pawn* victim = orxonox_cast<Pawn*>(otherObject); //if otherObject isn't a Pawn, then victim is NULL
    106107
    107108            if (this->owner_)
    108109            {
    109                 if (victim && !victim->hasShield())
     110                if (!victim || (victim && !victim->hasShield())) //same like below
    110111                {
    111112                    ParticleSpawner* effect = new ParticleSpawner(this->owner_->getCreator());
     
    116117                    effect->setLifetime(2.0f);
    117118                }
    118                 if (victim && !victim->hasShield())
     119                if (!victim || (victim && !victim->hasShield())) //same like above
    119120                {
    120121                    ParticleSpawner* effect = new ParticleSpawner(this->owner_->getCreator());
     
    137138
    138139            if (victim)
     140            {
    139141                victim->hit(this->owner_, contactPoint, this->damage_);
     142                victim->startReloadCountdown();
     143            }
    140144        }
    141145        return false;
    142146    }
     147//////////////////////////////////////////////////////////////////////end edit
    143148
    144149    void Projectile::setOwner(Pawn* owner)
Note: See TracChangeset for help on using the changeset viewer.