- Timestamp:
- Jul 24, 2005, 11:36:12 PM (19 years ago)
- Location:
- orxonox/trunk/src/world_entities
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/world_entities/player.cc
r4951 r4952 282 282 else if( event.type == KeyMapper::PEV_FIRE1) 283 283 this->bFire = event.bPressed; 284 else if( event.type == KeyMapper::PEV_NEXT_WEAPON) 285 if( !event.bPressed) this->bWeaponChange = !this->bWeaponChange; 286 287 } 284 else if( event.type == KeyMapper::PEV_NEXT_WEAPON && event.bPressed) 285 this->weaponMan->nextWeaponConf();//if( !event.bPressed) this->bWeaponChange = !this->bWeaponChange; 286 else if ( event.type == KeyMapper::PEV_PREVIOUS_WEAPON && event.bPressed) 287 this->weaponMan->previousWeaponConfig(); 288 } -
orxonox/trunk/src/world_entities/weapons/weapon_manager.cc
r4951 r4952 195 195 void WeaponManager::nextWeaponConf() 196 196 { 197 PRINTF(4)("Changing weapon configuration: from %i to next\n", this->currentConfigID);198 199 197 ++this->currentConfigID; 200 198 if (this->currentConfigID >= WM_MAX_CONFIGS) 201 199 this->currentConfigID = 0; 202 200 this->changeWeaponConfig(this->currentConfigID); 201 this->debug(); 202 } 203 204 void WeaponManager::previousWeaponConfig() 205 { 206 --this->currentConfigID; 207 if (this->currentConfigID < 0) 208 this->currentConfigID = WM_MAX_CONFIGS -1; 209 this->changeWeaponConfig(this->currentConfigID); 210 this->debug(); 211 212 213 } 214 215 void WeaponManager::changeWeaponConfig(int weaponConfig) 216 { 217 this->currentConfigID = weaponConfig; 218 PRINTF(4)("Changing weapon configuration: to %i\n", this->currentConfigID); 203 219 for (int i = 0; i < WM_MAX_SLOTS; i++) 204 220 { 205 221 this->currentSlotConfig[i].nextWeapon = this->configs[currentConfigID][i]; 206 if (this->currentSlotConfig[i].currentWeapon != this->currentSlotConfig[i].nextWeapon && this->currentSlotConfig[i].currentWeapon != NULL)222 if (this->currentSlotConfig[i].currentWeapon != NULL && this->currentSlotConfig[i].currentWeapon != this->currentSlotConfig[i].nextWeapon) 207 223 (this->currentSlotConfig[i].currentWeapon->requestAction(WA_DEACTIVATE)); 208 224 } 209 210 this->debug();211 225 } 212 226 -
orxonox/trunk/src/world_entities/weapons/weapon_manager.h
r4951 r4952 86 86 87 87 void nextWeaponConf(); 88 void previousWeaponConfig(); 89 void changeWeaponConfig(int weaponConfig); 88 90 89 91 void fire();
Note: See TracChangeset
for help on using the changeset viewer.