Changeset 5988 in orxonox.OLD for branches/powerups/src/world_entities/power_ups/weapon_power_up.cc
- Timestamp:
- Dec 8, 2005, 10:39:31 AM (18 years ago)
- File:
-
- 1 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 }
Note: See TracChangeset
for help on using the changeset viewer.