Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6710 in orxonox.OLD for trunk/src/world_entities/power_ups


Ignore:
Timestamp:
Jan 25, 2006, 4:18:12 PM (19 years ago)
Author:
bensch
Message:

merged the powerups back to the trunk

Location:
trunk/src/world_entities/power_ups
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/power_ups/power_up.cc

    r6589 r6710  
    7070    this->respawnTime -= dt;
    7171    if(this->respawnTime <= 0) {
     72      this->respawn();
    7273      this->toList(OM_COMMON);
    73       this->respawn();
    7474    }
    7575  }
  • trunk/src/world_entities/power_ups/weapon_power_up.cc

    r6695 r6710  
    5353  this->setClassID(CL_WEAPON_POWER_UP, "WeaponPowerUp");
    5454  this->weaponXML = NULL;
     55  this->weaponID = CL_NULL;
    5556  this->weapon = NULL;
    5657}
     
    7071    LoadParam(root, "weaponID", this, WeaponPowerUp, setWeaponClass);
    7172  }
    72   this->model = this->weapon->getModel(0);
    7373}
    7474
     
    8181{
    8282  this->weapon = dynamic_cast<Weapon*>((weaponXML == NULL)
    83       ? Factory::fabricate(static_cast<ClassID>(this->weapon->getClassID()))
    84       : Factory::fabricate(weaponXML));
     83      ? Factory::fabricate(static_cast<ClassID>(weaponID))
     84      : Factory::fabricate((TiXmlElement*)this->getXmlElem()->FirstChildElement("weapon")));
     85  this->model = this->weapon->getModel(0);
    8586}
    8687
     
    8889{
    8990  this->weapon = dynamic_cast<Weapon*>(Factory::fabricate(name));
     91  this->weaponID = (ClassID)this->weapon->getLeafClassID();
     92  this->model = this->weapon->getModel(0);
    9093}
    9194
  • trunk/src/world_entities/power_ups/weapon_power_up.h

    r6512 r6710  
    3434private:
    3535  Weapon* weapon;
     36  ClassID weaponID;
    3637  const TiXmlElement* weaponXML;
    3738
Note: See TracChangeset for help on using the changeset viewer.