Changeset 4906 in orxonox.OLD for orxonox/trunk/src/world_entities/weapons/weapon_manager.cc
- Timestamp:
- Jul 20, 2005, 1:41:19 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/world_entities/weapons/weapon_manager.cc
r4895 r4906 75 75 this->configs[i].slots[j] = NULL; 76 76 } 77 this->currConfID = W _CONFIG0;77 this->currConfID = WM_CONFIG0; 78 78 79 79 … … 141 141 * 142 142 * if you add explicitly a weapon at config:n, slot:m, the weapon placed at this location will be 143 * replaced by the weapon specified. if you use the W _FREE_SLOT, the manager will look for a free143 * replaced by the weapon specified. if you use the WM_FREE_SLOT, the manager will look for a free 144 144 * slot in this weaponconfiguration. if there is non, the weapon won't be added and there will be 145 145 * a error message. … … 147 147 void WeaponManager::addWeapon(Weapon* weapon, int configID, int slotID) 148 148 { 149 if( slotID == W _FREE_SLOT)149 if( slotID == WM_FREE_SLOT) 150 150 { 151 151 int freeSlot = this->getNextFreeSlot( configID); … … 187 187 lastConfID = this->currConfID; 188 188 for(i = this->currConfID + 1; i < W_MAX_CONFIGS && !this->configs[i].bUsed; ++i); 189 if( i == W_MAX_CONFIGS) this->currConfID = W _CONFIG0;189 if( i == W_MAX_CONFIGS) this->currConfID = WM_CONFIG0; 190 190 else this->currConfID = i; 191 191 … … 241 241 { 242 242 Weapon* w; 243 for (int j = 0; j < 4; ++j)244 for(int i = 0; i < W_MAX_SLOTS; ++i)245 {246 w = this->configs[j].slots[i];247 if( w != NULL) w->tick(dt);243 for(int i = 0; i < W_MAX_SLOTS; ++i) 244 { 245 w = this->configs[this->currConfID].slots[i]; 246 if( w != NULL && w->isActive()) 247 w->tickW(dt); 248 248 } 249 249 … … 262 262 { 263 263 w = this->configs[j].slots[i]; 264 if( w != NULL )264 if( w != NULL && w->isVisible()) 265 265 w->draw(); 266 266 }
Note: See TracChangeset
for help on using the changeset viewer.