Changeset 10438 in orxonox.OLD for trunk/src/world_entities/weapons
- Timestamp:
- Jan 28, 2007, 1:36:22 PM (18 years ago)
- Location:
- trunk/src/world_entities/weapons
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/weapons/weapon_manager.cc
r10437 r10438 316 316 weapon->setAmmoContainer(this->getAmmoContainer(weapon->getProjectileType())); 317 317 if(configID == this->currentConfigID) 318 this->currentSlotConfig[slotID]-> nextWeapon = weapon;318 this->currentSlotConfig[slotID]->setNextWeapon(weapon); 319 319 //if (this->parent != NULL) 320 320 { … … 425 425 426 426 for (int i = 0; i < WM_MAX_SLOTS; i++) 427 this->currentSlotConfig[i]-> nextWeapon = this->configs[currentConfigID][i];427 this->currentSlotConfig[i]->setNextWeapon(this->configs[currentConfigID][i]); 428 428 } 429 429 … … 458 458 for(int i = 0; i < this->slotCount; i++) 459 459 { 460 firingWeapon = this->currentSlotConfig[i]-> currentWeapon;460 firingWeapon = this->currentSlotConfig[i]->getCurrentWeapon(); 461 461 if( firingWeapon != NULL) firingWeapon->requestAction(WA_NONE); 462 462 } … … 485 485 486 486 // current Weapon in Slot i 487 tickWeapon = this->currentSlotConfig[i]-> currentWeapon;487 tickWeapon = this->currentSlotConfig[i]->getCurrentWeapon(); 488 488 // On A change (current != next) 489 if (tickWeapon != this->currentSlotConfig[i]-> nextWeapon)489 if (tickWeapon != this->currentSlotConfig[i]->getNextWeapon()) 490 490 { 491 491 // if a Weapon is Active in slot i, deactivate it. … … 500 500 { 501 501 tickWeapon->toList(OM_NULL); 502 this->currentSlotConfig[i]-> currentWeapon = NULL;502 this->currentSlotConfig[i]->setCurrentWeapon(NULL); 503 503 } 504 504 } 505 505 // switching to next Weapon 506 tickWeapon = this->currentSlotConfig[i]->currentWeapon = this->currentSlotConfig[i]->nextWeapon; 506 this->currentSlotConfig[i]->setCurrentWeapon(this->currentSlotConfig[i]->getNextWeapon()); 507 tickWeapon = this->currentSlotConfig[i]->getCurrentWeapon(); 507 508 508 509 if (tickWeapon != NULL) … … 520 521 } 521 522 else if (unlikely(tickWeapon != NULL && tickWeapon->getCurrentState() == WS_DEACTIVATING)) 522 this->currentSlotConfig[i]-> nextWeapon = NULL;523 this->currentSlotConfig[i]->setNextWeapon(NULL); 523 524 } 524 525 } … … 534 535 for (int i = 0; i < this->slotCount; i++) 535 536 { 536 drawWeapon = this->currentSlotConfig[i]-> currentWeapon;537 drawWeapon = this->currentSlotConfig[i]->getCurrentWeapon(); 537 538 if( drawWeapon != NULL && drawWeapon->isVisible()) 538 539 drawWeapon->draw(); -
trunk/src/world_entities/weapons/weapon_slot.h
r10437 r10438 33 33 inline void setNextWeapon(Weapon* weapon) { this->nextWeapon = weapon; } 34 34 35 //private:35 private: 36 36 37 37 long capability; //!< the capabilities of the Slot @see WeaponSlotCapability.
Note: See TracChangeset
for help on using the changeset viewer.