Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 27, 2009, 4:13:13 AM (15 years ago)
Author:
landauf
Message:
  • The gametype pointer in BaseObject is now also a SmartPtr
  • The GametypeInfo object in Gametype is now a pointer instead of a member object to prevent double free (once deleted by the unloader and once when the gametype gets destroyed)
  • GSLevel sets the Gametype of all HumanPlayer objects to 0 because they don't get deleted and would prevent the Gametype from being destroyed.
  • Fixed a bug in HumanPlayer when Gametype is set to 0

Unloading seems to work with bots now.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core5/src/libraries/core/BaseObject.h

    r5805 r5806  
    138138            inline const SmartPtr<Scene>& getScene() const { return this->scene_; }
    139139
    140             inline void setGametype(Gametype* gametype)
     140            inline void setGametype(const SmartPtr<Gametype>& gametype)
    141141            {
    142142                if (gametype != this->gametype_)
     
    147147                }
    148148            }
    149             inline Gametype* getGametype() const { return this->gametype_; }
     149            inline const SmartPtr<Gametype>& getGametype() const { return this->gametype_; }
    150150            inline Gametype* getOldGametype() const { return this->oldGametype_; }
    151151            virtual void changedGametype() {}
     
    196196            BaseObject*            creator_;
    197197            SmartPtr<Scene>        scene_;
    198             Gametype*              gametype_;
     198            SmartPtr<Gametype>     gametype_;
    199199            Gametype*              oldGametype_;
    200200            std::set<Template*>    templates_;
Note: See TracChangeset for help on using the changeset viewer.