Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6484 for code/branches


Ignore:
Timestamp:
Mar 7, 2010, 11:00:05 PM (15 years ago)
Author:
dafrick
Message:

Cleanup and bug fixes.

Location:
code/branches/pickup3/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • code/branches/pickup3/src/modules/pickup/PickupManager.cc

    r6475 r6484  
    5252    PickupManager::PickupManager()
    5353    {
     54        this->defaultRepresentation_ = NULL;
     55        this->pickupCarrierStructure_ = NULL;
    5456        RegisterRootObject(PickupManager);
    5557       
     
    8587    bool PickupManager::registerRepresentation(const PickupIdentifier* identifier, PickupRepresentation* representation)
    8688    {
    87         if(this->representations_.find(identifier) == this->representations_.end()) //!< If the Pickupable already has a RepresentationRegistered.
     89        if(this->representations_.find(identifier) != this->representations_.end()) //!< If the Pickupable already has a RepresentationRegistered.
    8890            return false;
    8991       
  • code/branches/pickup3/src/modules/pickup/PickupRepresentation.cc

    r6478 r6484  
    103103       
    104104        PickupManager::getInstance().registerRepresentation(this->pickup_->getPickupIdentifier(), this); //!< Registers the PickupRepresentation with the PickupManager through the PickupIdentifier of the Pickupable it represents.
     105       
     106        if(this->spawnerRepresentation_ != NULL)
     107            this->spawnerRepresentation_->setVisible(false);
     108       
     109        COUT(4) << "PickupRepresentation created: name: '" << this->name_ << "', description: '" << this->description_ << "', spawnerTemplate: '" << this->spawnerTemplate_ << "'." << std::endl;
    105110    }
    106111   
     
    128133       
    129134        StaticEntity* representation = this->spawnerRepresentation_;
     135        representation->setVisible(true);
    130136       
    131137        this->addTemplate(this->spawnerTemplate_);
     138        this->spawnerRepresentation_->setVisible(false);
    132139       
    133140        return representation;
  • code/branches/pickup3/src/modules/pickup/PickupSpawner.cc

    r6478 r6484  
    147147        {
    148148            PickupRepresentation* representation = PickupManager::getInstance().getRepresentation(this->pickup_->getPickupIdentifier());
     149            representation->setVisible(this->isActive());
    149150            this->attach(representation->getSpawnerRepresentation(this));
     151            this->setActive(true);
    150152        }
    151153    }
     
    273275    void PickupSpawner::trigger(Pawn* pawn)
    274276    {
    275         if (this->isActive()) //!< Checks whether PickupItem is active.
    276         {
     277        COUT(1) << "PickupSpawner triggered." << std::endl;
     278        if (this->isActive()) //!< Checks whether PickupSpawner is active.
     279        {
     280            COUT(1) << "PickupSpawner triggered and active." << std::endl;
     281           
    277282            PickupCarrier* carrier = dynamic_cast<PickupCarrier*>(pawn);
    278283            if(carrier == NULL)
  • code/branches/pickup3/src/modules/pickup/items/HealthPickup.cc

    r6480 r6484  
    120120        if(!this->isContinuous())
    121121            this->healthRate_ = 0.0;
    122        
    123         COUT(1) << "HealthPickup " << this->getHealth() << ", " << this->getHealthRate() << ", " << this->getHealthType() << "." << std::endl;
    124122       
    125123        this->initializeIdentifier();
  • code/branches/pickup3/src/orxonox/pickup/PickupIdentifier.cc

    r6480 r6484  
    101101    bool PickupIdentifier::addParameter(std::string & name, std::string & value)
    102102    {
    103         COUT(1) << "PickupIdentifier " << name << ", " << value << std::endl;
     103        COUT(4) << "PickupIdentifier " << name << ", " << value << std::endl;
    104104       
    105105        if(!(this->parameters_.find(name) == this->parameters_.end()))
Note: See TracChangeset for help on using the changeset viewer.