Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7852


Ignore:
Timestamp:
Feb 10, 2011, 11:46:07 PM (13 years ago)
Author:
landauf
Message:

fixed crash in Pong gametype if the game was ended right after the ball was set back to center after a score

Location:
code/trunk/src/modules/pong
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/modules/pong/Pong.h

    r5929 r7852  
    5959            void startBall();
    6060
    61             PongCenterpoint* center_;
    62             PongBall* ball_;
    63             PongBat* bat_[2];
     61            WeakPtr<PongCenterpoint> center_;
     62            WeakPtr<PongBall> ball_;
     63            WeakPtr<PongBat> bat_[2];
    6464            Timer starttimer_;
    6565    };
  • code/trunk/src/modules/pong/PongBall.cc

    r6417 r7852  
    165165    }
    166166
    167     void PongBall::setBats(PongBat** bats)
     167    void PongBall::setBats(WeakPtr<PongBat>* bats)
    168168    {
    169169        this->bat_ = bats;
     
    175175    {
    176176        if (!this->bat_)
    177             this->bat_ = new PongBat*[2];
     177            this->bat_ = new WeakPtr<PongBat>[2]; // TODO: delete this somewhere
    178178        if (this->batID_[0] != OBJECTID_UNKNOWN)
    179179            this->bat_[0] = orxonox_cast<PongBat*>(Synchronisable::getSynchronisable(this->batID_[0]));
  • code/trunk/src/modules/pong/PongBall.h

    r7163 r7852  
    6666                { return this->batlength_; }
    6767
    68             void setBats(PongBat** bats);
     68            void setBats(WeakPtr<PongBat>* bats);
    6969            void applyBats();
    7070
     
    7979            float accelerationFactor_;
    8080            float batlength_;
    81             PongBat** bat_;
     81            WeakPtr<PongBat>* bat_;
    8282            unsigned int* batID_;
    8383            float relMercyOffset_;
Note: See TracChangeset for help on using the changeset viewer.