Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 8, 2005, 10:39:31 AM (19 years ago)
Author:
manuel
Message:

branch compiles again. factory problems solved

Location:
branches/powerups/src/world_entities/power_ups
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/powerups/src/world_entities/power_ups/weapon_power_up.cc

    r5986 r5988  
    4949void WeaponPowerUp::init()
    5050{
     51  weaponXML = NULL;
     52  weapon = NULL;
    5153}
    5254
     
    5658  static_cast<PowerUp*>(this)->loadParams(root);
    5759  const TiXmlElement* elem = root->FirstChildElement("weapon");
    58   if(elem != NULL && (elem = elem->getFirstChildElement()) != NULL)
     60  if(elem != NULL && (elem = elem->FirstChildElement()) != NULL)
    5961  {
    6062    this->weaponXML = elem;
     
    7577{
    7678  this->weapon = dynamic_cast<Weapon*>((weaponXML == NULL)
    77       ? Factory::getFirst()->fabricate(static_cast<ClassID>(this->weapon->getClassID()))
    78       : Factory::getFirst()->fabricate(weaponXML));
     79      ? Factory::fabricate(static_cast<ClassID>(this->weapon->getClassID()))
     80      : Factory::fabricate(weaponXML));
    7981}
    8082
    8183void WeaponPowerUp::setWeaponClass(const char* name)
    8284{
    83   this->weapon = dynamic_cast<Weapon*>(Factory::getFirst()->fabricate(name, name));
     85  this->weapon = dynamic_cast<Weapon*>(Factory::fabricate(name));
    8486}
     87
     88void WeaponPowerUp::hide()
     89{
     90  PowerUp::hide();
     91  this->createWeapon();
     92}
  • branches/powerups/src/world_entities/power_ups/weapon_power_up.h

    r5973 r5988  
    2222  void setWeaponClass(const char* name);
    2323
     24protected:
     25  void hide();
     26
    2427private:
    2528  void init();
Note: See TracChangeset for help on using the changeset viewer.