Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 30, 2009, 12:42:28 PM (15 years ago)
Author:
scheusso
Message:

Fixed problem with scene and creators
creatorID is now always the objectID of the scene except for the case

  • if the object is the scene (then the creatorID is OBJECTID_UNKNOWN)
  • if the object is "above" the scene (e.g. level), then the cID is also OBJECTID_UNKNOWN
Location:
code/branches/core5/src/libraries/core
Files:
2 edited

Legend:

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

    r5821 r5839  
    4646#include "XMLNameListener.h"
    4747#include "XMLPort.h"
     48#include "network/NetworkPrereqs.h"
    4849
    4950namespace orxonox
     
    7475            this->setFile(this->creator_->getFile());
    7576            this->setNamespace(this->creator_->getNamespace());
    76             this->setScene(this->creator_->getScene());
     77            this->setScene(this->creator_->getScene(), this->creator_->getSceneID());
    7778            this->setGametype(this->creator_->getGametype());
    7879        }
     
    8283            this->namespace_ = 0;
    8384            this->scene_ = 0;
     85            this->sceneID_ = OBJECTID_UNKNOWN;
    8486            this->gametype_ = 0;
    8587        }
  • code/branches/core5/src/libraries/core/BaseObject.h

    r5829 r5839  
    135135            inline BaseObject* getCreator() const { return this->creator_; }
    136136
    137             inline void setScene(const SmartPtr<Scene>& scene) { this->scene_ = scene; }
     137            inline void setScene(const SmartPtr<Scene>& scene, uint32_t sceneID) { this->scene_ = scene; this->sceneID_=sceneID; }
    138138            inline const SmartPtr<Scene>& getScene() const { return this->scene_; }
     139            inline virtual uint32_t getSceneID() const { return this->sceneID_; }
    139140
    140141            inline void setGametype(const SmartPtr<Gametype>& gametype)
     
    202203            std::list<BaseObject*> events_;
    203204            std::map<std::string, EventContainer*> eventContainers_;
     205            uint32_t               sceneID_;
    204206    };
    205207
Note: See TracChangeset for help on using the changeset viewer.