Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 25, 2011, 9:28:29 PM (13 years ago)
Author:
dafrick
Message:

Reverse merge to revert last, failed, merge. Apparently you can't partially commit a merge.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation/src/modules/weapons/projectiles/SimpleRocket.cc

    r8578 r8579  
    2323 *      Oliver Scheuss
    2424 *   Co-authors:
    25  *      simonmie
     25 *      ...
    2626 *
    2727 */
     
    4848    CreateFactory(SimpleRocket);
    4949
    50     SimpleRocket::SimpleRocket(BaseObject* creator) : ControllableEntity(creator), BasicProjectile()
     50    SimpleRocket::SimpleRocket(BaseObject* creator) : ControllableEntity(creator)
    5151    {
    5252        RegisterObject(SimpleRocket);// - register the SimpleRocket class to the core
    5353
    5454        this->localAngularVelocity_ = 0;
     55        this->bDestroy_ = false;
    5556        this->lifetime_ = 120;
    5657
    5758        this->setMass(15);
    58 //        COUT(4) << "simplerocket constructed\n";
     59        COUT(4) << "simplerocket constructed\n";
    5960
    6061        if (GameMode::isMaster())
     
    114115                this->disableFire();
    115116
    116             if( this->getBDestroy() )
     117            if( this->bDestroy_ )
    117118                this->destroy();
    118119        }
     
    158159    {
    159160        this->owner_ = owner;
    160         this->player_ = this->getOwner()->getPlayer();
    161     }
    162 
    163 
    164     /* Calls the collidesAgainst function of BasicProjectile
    165      */
     161        this->player_ = this->owner_->getPlayer();
     162    }
     163
     164
     165
     166
    166167    bool SimpleRocket::collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint)
    167168    {
    168         return BasicProjectile::basicCollidesAgainst(otherObject,contactPoint,this->getOwner(),this);
     169        if (!this->bDestroy_ && GameMode::isMaster())
     170        {
     171            if (otherObject == this->owner_)
     172                return false;
     173
     174            this->bDestroy_ = true;
     175
     176            if (this->owner_)
     177            {
     178                {
     179                    ParticleSpawner* effect = new ParticleSpawner(this->owner_->getCreator());
     180                    effect->setPosition(this->getPosition());
     181                    effect->setOrientation(this->getOrientation());
     182                    effect->setDestroyAfterLife(true);
     183                    effect->setSource("Orxonox/explosion4");
     184                    effect->setLifetime(2.0f);
     185                }
     186
     187                {
     188                    ParticleSpawner* effect = new ParticleSpawner(this->owner_->getCreator());
     189                    effect->setPosition(this->getPosition());
     190                    effect->setOrientation(this->getOrientation());
     191                    effect->setDestroyAfterLife(true);
     192                    effect->setSource("Orxonox/smoke4");
     193                    effect->setLifetime(3.0f);
     194                }
     195            }
     196
     197            float dmg = this->damage_;
     198//             if (this->owner_)
     199//                 dmg = this->owner_->getPickups().processModifiers(ModifierType::Damage, dmg, false);
     200
     201            Pawn* victim = orxonox_cast<Pawn*>(otherObject);
     202            if (victim)
     203                victim->hit(this->owner_, contactPoint, dmg);
     204        }
     205        return false;
    169206    }
    170207
Note: See TracChangeset for help on using the changeset viewer.