Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 16, 2019, 2:53:00 PM (5 years ago)
Author:
pomselj
Message:

Projectiles survive infinitely

Location:
code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/BallProjectile.cc

    r12376 r12378  
    104104        Vector3 myPosition = otherObject->getPosition();
    105105        btVector3 positionOtherObject = contactPoint.getPositionWorldOnA();
    106         //orxout() << "About to Bounce >D" << endl;
    107         //if (positionOtherObject.y < 0) {
    108             //this.destroy()
    109         //}S
    110         //else {
    111106       
    112107            int distance_X = positionOtherObject.getX() - myPosition.x;
     
    143138    bool BallProjectile::processCollision(WorldEntity* otherObject, btManifoldPoint& contactPoint, const btCollisionShape* cs)
    144139    {
    145 
    146         //orxout() << "wanna bounce..." << endl;
    147140        bool result = BasicProjectile::processCollision(otherObject, contactPoint, cs);
    148141        if (result == true) {
    149142            if (otherObject->isA(Class(OrxoBloxStones))) {
    150143                Bounce(otherObject, contactPoint, cs);
    151             }
    152         }
    153         //orxout() << "BOUNCED!" << endl;
    154 
     144                orxout() << "BOUNCED!" << endl;
     145            }
     146        }
    155147        return result;
    156148    }
     
    289281    }
    290282
     283    void BallProjectile::destroyObject(void)
     284    {
     285        if(GameMode::isMaster()) {
     286        }
     287    }
     288
     289
    291290
    292291}
  • code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/BallProjectile.h

    r12368 r12378  
    6565
    6666        private:
    67 
     67            void destroyObject() override;
    6868            void registerVariables();
    6969            void changeTexture();
  • code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/BasicProjectile.cc

    r12376 r12378  
    8585    bool BasicProjectile::processCollision(WorldEntity* otherObject, btManifoldPoint& contactPoint, const btCollisionShape* cs)
    8686    {
    87         //orxout() << "OMG A COLLISION" << endl;
    8887        if (!this->bDestroy_ && GameMode::isMaster())
    8988        {
     
    9392            if (getDestroyAfterCollision())
    9493            {
     94                orxout() << "Destroy that stuff" << endl;
    9595                this->bDestroy_ = true; // If something is hit, the object is destroyed and can't hit something else.
    9696                                        // The projectile is destroyed by its tick()-function (in the following tick).
     
    173173    void BasicProjectile::destroyCheck(void)
    174174    {
    175         if(GameMode::isMaster() && this->bDestroy_)
     175        if(GameMode::isMaster() && this->bDestroy_) {
     176            orxout() << "Set true, smhow" << endl;
    176177            this->destroy();
     178        }
    177179    }
    178180
     
    183185    void BasicProjectile::destroyObject(void)
    184186    {
    185         if(GameMode::isMaster())
     187        if(GameMode::isMaster()) {
     188            orxout() << "Deleted myself" << endl;
    186189            this->destroy();
     190        }
    187191    }
    188192}
Note: See TracChangeset for help on using the changeset viewer.