Changeset 6142 in orxonox.OLD for trunk/src/world_entities/weapons/weapon_manager.cc
- Timestamp:
- Dec 16, 2005, 7:13:57 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/weapons/weapon_manager.cc
r6074 r6142 35 35 * @param number of weapon slots of the model/ship <= 8 (limitied) 36 36 */ 37 WeaponManager::WeaponManager( PNode* parent)37 WeaponManager::WeaponManager(WorldEntity* parent) 38 38 { 39 39 this->init(); … … 155 155 * a PNode. 156 156 */ 157 void WeaponManager::setParent(PNode* parent) 158 { 159 if (parent == NULL) 160 parent = PNode::getNullParent(); 157 void WeaponManager::setParent(WorldEntity* parent) 158 { 161 159 this->parent = parent; 162 160 if (this->parent != NULL) … … 247 245 this->configs[configID][slotID] = weapon; 248 246 if (this->parent != NULL) 249 weapon->setParent(parent); 247 { 248 this->parent->addChild(weapon); 249 } 250 250 PRINTF(3)("Added a new Weapon to the WeaponManager: config %i/ slot %i\n", configID, slotID); 251 251 } … … 373 373 else 374 374 { 375 if (this->currentSlotConfig[i].currentWeapon != NULL) 376 this->currentSlotConfig[i].currentWeapon->toList(OM_NULL); 375 377 tickWeapon = this->currentSlotConfig[i].currentWeapon = this->currentSlotConfig[i].nextWeapon; 376 378 if (tickWeapon != NULL) … … 378 380 tickWeapon->requestAction(WA_ACTIVATE); 379 381 tickWeapon->setParent(&this->currentSlotConfig[i].position); 382 tickWeapon->toList(this->parent->getOMListNumber()); 380 383 this->currentSlotConfig[i].position.activateNode(); 381 384 }
Note: See TracChangeset
for help on using the changeset viewer.