Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 17, 2012, 6:24:06 PM (12 years ago)
Author:
landauf
Message:

small cleanup. calling addTemplate() only once instead of twice

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2012merge/src/modules/pickup/PickupRepresentation.cc

    r8858 r9302  
    151151        Returns a pointer to the StaticEntity.
    152152    */
    153     StaticEntity* PickupRepresentation::getSpawnerRepresentation(PickupSpawner* spawner)
     153    StaticEntity* PickupRepresentation::createSpawnerRepresentation(PickupSpawner* spawner)
    154154    {
    155155        if(this->spawnerRepresentation_ == NULL)
     
    158158            if(this->spawnerTemplate_ == "")
    159159            {
    160                 orxout(verbose, context::pickups) << "PickupRepresentation: Spawner template is empty." << endl;
     160                orxout(internal_warning, context::pickups) << "PickupRepresentation: Spawner template is empty." << endl;
    161161                // If neither spawnerRepresentation nor spawnerTemplate was specified
    162162                return this->getDefaultSpawnerRepresentation(spawner);
     
    165165        }
    166166
    167         StaticEntity* representation = this->spawnerRepresentation_;
    168         representation->setVisible(true);
    169 
    170         this->addTemplate(this->spawnerTemplate_);
    171         this->spawnerRepresentation_->setVisible(false);
    172 
    173         return representation;
     167        this->spawnerRepresentation_->setVisible(true);
     168        StaticEntity* temp = this->spawnerRepresentation_;
     169        this->spawnerRepresentation_ = NULL;
     170
     171        return temp;
    174172    }
    175173
Note: See TracChangeset for help on using the changeset viewer.