Changeset 4122 in orxonox.OLD for orxonox/branches/heightMap/src/world_entities/weapon.cc
- Timestamp:
- May 9, 2005, 11:29:19 AM (20 years ago)
- Location:
- orxonox/branches/heightMap
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/heightMap
- Property svn:externals
-
old new 1 data http://svn.orxonox.ethz.ch/data 1
-
- Property svn:externals
-
orxonox/branches/heightMap/src/world_entities/weapon.cc
r3888 r4122 110 110 void WeaponManager::nextWeaponConf() 111 111 { 112 PRINTF(4)("Changing weapon configuration: from %i\n", this->currConfID); 113 114 Weapon* w; 115 for(int i = 0; i < W_MAX_SLOTS; ++i) 116 { 117 w = this->configs[this->currConfID].slots[i]; 118 if( w != NULL) w->deactivate(); 119 } 120 int i; 112 PRINTF(4)("Changing weapon configuration: from %i to next\n", this->currConfID); 113 114 int i, lastConfID; 115 lastConfID = this->currConfID; 121 116 for(i = this->currConfID + 1; i < W_MAX_CONFIGS && !this->configs[i].bUsed; ++i); 122 117 if( i == W_MAX_CONFIGS) this->currConfID = W_CONFIG0; 123 118 else this->currConfID = i; 124 PRINTF(4)("\tto %i\n", this->currConfID); 125 126 for(int i = 0; i < W_MAX_SLOTS; ++i) 127 { 128 w = this->configs[this->currConfID].slots[i]; 129 if( w != NULL) w->activate(); 119 120 121 Weapon *w1, *w2; 122 for(int j = 0; j < W_MAX_SLOTS; ++j) 123 { 124 w1 = this->configs[lastConfID].slots[j]; 125 w2 = this->configs[this->currConfID].slots[j]; 126 127 if( w1 == w2) 128 { 129 printf("no need for change\n"); 130 } 131 else 132 { 133 if( w1 != NULL ) 134 { 135 w1->deactivate(); 136 printf("deactivating %i,%i\n", j,lastConfID); 137 } 138 if( w2 != NULL) 139 { 140 w2->activate(); 141 printf("activating %i,%i\n", j, this->currConfID); 142 } 143 } 130 144 } 131 145 }
Note: See TracChangeset
for help on using the changeset viewer.