Changeset 5988 in orxonox.OLD for branches/powerups/src/world_entities
- Timestamp:
- Dec 8, 2005, 10:39:31 AM (19 years ago)
- Location:
- branches/powerups/src/world_entities
- Files:
-
- 3 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(); -
branches/powerups/src/world_entities/space_ships/space_ship.cc
r5985 r5988 419 419 { 420 420 if(powerUp->isA(CL_WEAPON_POWER_UP)) { 421 Weapon weapon = dynamic_cast<WeaponPowerUp*>(powerUp)->getWeapon();421 Weapon* weapon = dynamic_cast<WeaponPowerUp*>(powerUp)->getWeapon(); 422 422 WeaponManager* manager = this->getWeaponManager(); 423 423 int slot = manager->getNextFreeSlot(0, weapon->getCapability());
Note: See TracChangeset
for help on using the changeset viewer.