Changeset 5440 in orxonox.OLD for trunk/src/world_entities/weapons
- Timestamp:
- Oct 27, 2005, 10:56:58 PM (19 years ago)
- Location:
- trunk/src/world_entities/weapons
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/weapons/turret.cc
r5414 r5440 97 97 this->setEmissionPoint(1.684, 0.472, 0); 98 98 //this->getProjectileFactory()->prepare(100); 99 100 101 99 } 102 100 … … 140 138 if (target != NULL) 141 139 { 142 pj->setVelocity(this->getVelocity()+(this->getAbsDir().apply(Vector(1,0,0))*100.0 /*target->getAbsCoor() - this->getAbsCoor()*/)*.5);//this->getVelocity()); 140 pj->setVelocity(this->getVelocity()+(this->getAbsDir().apply(Vector(1,0,0))*100.0 + VECTOR_RAND(20) 141 /*target->getAbsCoor() - this->getAbsCoor()*/)*.5);//this->getVelocity()); 143 142 } 144 143 else … … 148 147 pj->setAbsCoor(this->getEmissionPoint()); 149 148 pj->setAbsDir(this->getAbsDir()); 149 150 150 State::getWorldEntityList()->add(pj); 151 151 } 152 153 152 154 153 void Turret::destroy () -
trunk/src/world_entities/weapons/weapon_manager.cc
r5435 r5440 220 220 if (unlikely(configID >= WM_MAX_CONFIGS || slotID >= (int)this->slotCount)) 221 221 { 222 PRINTF(2)("Slot %d of config %d is not availiabe \n", slotID, configID);222 PRINTF(2)("Slot %d of config %d is not availiabe (max: %d)\n", slotID, configID, this->slotCount); 223 223 return; 224 224 } … … 238 238 239 239 //! @todo check if the weapon is already assigned to another config in another slot 240 241 240 this->configs[configID][slotID] = weapon; 242 241 if (this->parent != NULL) … … 403 402 * @param the selected weaponconfig 404 403 */ 405 int WeaponManager::getNextFreeSlot(int configID )404 int WeaponManager::getNextFreeSlot(int configID, long capability) 406 405 { 407 406 for( int i = 0; i < this->slotCount; ++i) 408 407 { 409 if( this->configs[configID][i] == NULL) 408 if( this->configs[configID][i] == NULL && 409 (this->currentSlotConfig[i].capability & capability == this->currentSlotConfig[i].capability)) 410 410 return i; 411 411 } -
trunk/src/world_entities/weapons/weapon_manager.h
r5435 r5440 87 87 88 88 private: 89 int getNextFreeSlot(int configID );89 int getNextFreeSlot(int configID, long capability = WTYPE_ALL); 90 90 91 91 private:
Note: See TracChangeset
for help on using the changeset viewer.