Changeset 5988 in orxonox.OLD for branches/powerups/src/world_entities/power_ups
- Timestamp:
- Dec 8, 2005, 10:39:31 AM (19 years ago)
- 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 49 49 void WeaponPowerUp::init() 50 50 { 51 weaponXML = NULL; 52 weapon = NULL; 51 53 } 52 54 … … 56 58 static_cast<PowerUp*>(this)->loadParams(root); 57 59 const TiXmlElement* elem = root->FirstChildElement("weapon"); 58 if(elem != NULL && (elem = elem-> getFirstChildElement()) != NULL)60 if(elem != NULL && (elem = elem->FirstChildElement()) != NULL) 59 61 { 60 62 this->weaponXML = elem; … … 75 77 { 76 78 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)); 79 81 } 80 82 81 83 void WeaponPowerUp::setWeaponClass(const char* name) 82 84 { 83 this->weapon = dynamic_cast<Weapon*>(Factory:: getFirst()->fabricate(name,name));85 this->weapon = dynamic_cast<Weapon*>(Factory::fabricate(name)); 84 86 } 87 88 void WeaponPowerUp::hide() 89 { 90 PowerUp::hide(); 91 this->createWeapon(); 92 } -
branches/powerups/src/world_entities/power_ups/weapon_power_up.h
r5973 r5988 22 22 void setWeaponClass(const char* name); 23 23 24 protected: 25 void hide(); 26 24 27 private: 25 28 void init();
Note: See TracChangeset
for help on using the changeset viewer.