Changeset 3875 in orxonox.OLD for orxonox/trunk/src/world_entities
- Timestamp:
- Apr 18, 2005, 4:52:45 PM (20 years ago)
- Location:
- orxonox/trunk/src/world_entities
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/world_entities/player.cc
r3873 r3875 58 58 59 59 this->weaponMan->addWeapon(wpRight); 60 this->weaponMan->addWeapon(wpLeft); 60 61 61 62 this->weapons->add(wpRight); … … 216 217 { 217 218 //if(this->activeWeapon != NULL) 218 this->activeWeapon->fire();219 //this->activeWeapon->fire(); 219 220 //FIX THIS FIX FIIIIIIIIIIIX 220 this->activeWeaponL->fire(); 221 //this->activeWeaponL->fire(); 222 this->weaponMan->fire(); 221 223 } 222 224 if( this->bWeaponChange && this->weapons->getSize() > 1) -
orxonox/trunk/src/world_entities/weapon.cc
r3873 r3875 39 39 this->nrOfSlots = nrOfSlots; 40 40 41 this->currConfID = W_CONFIG1; 41 for(int i = 0; i < W_MAX_CONFIGS; ++i) 42 for(int j = 0; j < W_MAX_SLOTS; ++j) 43 this->configs[i].slots[j] = NULL; 44 45 this->currConfID = W_CONFIG0; 42 46 this->configs[this->currConfID].bUsed = true; 43 47 } … … 91 95 92 96 97 void WeaponManager::fire() 98 { 99 Weapon* firingWeapon; 100 for(int i = 0; i < W_MAX_SLOTS; ++i) 101 { 102 firingWeapon = this->configs[this->currConfID].slots[i]; 103 if( firingWeapon != NULL) firingWeapon->fire(); 104 } 105 } 106 107 93 108 /** 94 109 \brief standard constructor -
orxonox/trunk/src/world_entities/weapon.h
r3873 r3875 79 79 ~WeaponManager(); 80 80 81 void addWeapon(Weapon* weapon, int slotID = W_FREE_SLOT, int configID = W_CONFIG 1);81 void addWeapon(Weapon* weapon, int slotID = W_FREE_SLOT, int configID = W_CONFIG0); 82 82 void nextWeaponConf(); 83 83 84 void fire(); 84 85 85 86 private: 86 87 int nrOfConfigs; //<! number of configurations defined 87 88 int nrOfSlots; //<! number of weapon slots a ship has 88 int currConfID; //<! the currently selected config89 int currConfID; //<! the currently selected config 89 90 weaponConfig configs[4]; //<! a list of four configurations 90 91
Note: See TracChangeset
for help on using the changeset viewer.