- Timestamp:
- Jan 25, 2006, 4:18:12 PM (19 years ago)
- Location:
- trunk/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/story_entities/game_world.cc
r6634 r6710 300 300 void GameWorld::tick(std::list<WorldEntity*> entityList, float dt) 301 301 { 302 std::list<WorldEntity*>::iterator entity; 303 for (entity = entityList.begin(); entity != entityList.end(); entity++) 302 std::list<WorldEntity*>::iterator entity, next; 303 next = entityList.begin(); 304 while (next != entityList.end()) 305 { 306 entity = next++; 304 307 (*entity)->tick(dt); 305 308 } 306 309 } 307 310 -
trunk/src/world_entities/playable.cc
r6700 r6710 161 161 Weapon* weapon = dynamic_cast<WeaponPowerUp*>(powerUp)->getWeapon(); 162 162 WeaponManager* manager = this->getWeaponManager(); 163 manager->addWeapon(weapon, 2, -1); 164 return true; 163 return manager->addWeapon(weapon); 165 164 } 166 165 else if(powerUp->isA(CL_PARAM_POWER_UP)) { -
trunk/src/world_entities/power_ups/power_up.cc
r6589 r6710 70 70 this->respawnTime -= dt; 71 71 if(this->respawnTime <= 0) { 72 this->respawn(); 72 73 this->toList(OM_COMMON); 73 this->respawn();74 74 } 75 75 } -
trunk/src/world_entities/power_ups/weapon_power_up.cc
r6695 r6710 53 53 this->setClassID(CL_WEAPON_POWER_UP, "WeaponPowerUp"); 54 54 this->weaponXML = NULL; 55 this->weaponID = CL_NULL; 55 56 this->weapon = NULL; 56 57 } … … 70 71 LoadParam(root, "weaponID", this, WeaponPowerUp, setWeaponClass); 71 72 } 72 this->model = this->weapon->getModel(0);73 73 } 74 74 … … 81 81 { 82 82 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); 85 86 } 86 87 … … 88 89 { 89 90 this->weapon = dynamic_cast<Weapon*>(Factory::fabricate(name)); 91 this->weaponID = (ClassID)this->weapon->getLeafClassID(); 92 this->model = this->weapon->getModel(0); 90 93 } 91 94 -
trunk/src/world_entities/power_ups/weapon_power_up.h
r6512 r6710 34 34 private: 35 35 Weapon* weapon; 36 ClassID weaponID; 36 37 const TiXmlElement* weaponXML; 37 38 -
trunk/src/world_entities/space_ships/space_ship.cc
r6700 r6710 130 130 this->getWeaponManager()->changeWeaponConfig(1); 131 131 132 //EventHandler::getInstance()->grabEvents(true);132 EventHandler::getInstance()->grabEvents(true); 133 133 134 134 bUp = bDown = bLeft = bRight = bAscend = bDescend = bRollL = bRollR = false;
Note: See TracChangeset
for help on using the changeset viewer.