- Timestamp:
- Jan 18, 2006, 3:00:56 PM (19 years ago)
- Location:
- trunk/src/world_entities
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/creatures/md2_creature.cc
r6512 r6561 208 208 } 209 209 210 211 /**212 * adds a weapon to the weapon list of the MD2Creature213 * @param weapon to add214 */215 void MD2Creature::addWeapon(Weapon* weapon)216 {217 this->getWeaponManager()->addWeapon(weapon);218 }219 220 221 /**222 * removes a weapon from the MD2Creature223 * @param weapon to remove224 */225 void MD2Creature::removeWeapon(Weapon* weapon)226 {227 this->getWeaponManager()->removeWeapon(weapon);228 }229 210 230 211 /** -
trunk/src/world_entities/creatures/md2_creature.h
r6512 r6561 29 29 virtual void enter(); 30 30 virtual void leave(); 31 32 void addWeapon(Weapon* weapon );33 void removeWeapon(Weapon* weapon);34 31 35 32 virtual void postSpawn(); -
trunk/src/world_entities/weapons/turret.cc
r6547 r6561 94 94 this->setProjectileType(CL_ROCKET); 95 95 96 this->loadModel("models/guns/turret1.obj"); 96 97 97 98 this->setEmissionPoint(1.684, 0.472, 0); … … 102 103 { 103 104 Weapon::loadParams(root); 104 105 105 } 106 106 -
trunk/src/world_entities/weapons/weapon_manager.cc
r6512 r6561 22 22 #include "weapon.h" 23 23 #include "crosshair.h" 24 25 #include "playable.h" 24 26 25 27 #include "load_param.h" … … 213 215 * a error message. 214 216 */ 215 voidWeaponManager::addWeapon(Weapon* weapon, int configID, int slotID)217 bool WeaponManager::addWeapon(Weapon* weapon, int configID, int slotID) 216 218 { 217 219 if (unlikely(configID >= WM_MAX_CONFIGS || slotID >= (int)this->slotCount)) 218 220 { 219 221 PRINTF(2)("Slot %d of config %d is not availiabe (max: %d)\n", slotID, configID, this->slotCount); 220 return ;222 return false; 221 223 } 222 224 … … 230 232 { 231 233 PRINTF(1)("There is no free slot in this WeaponConfig to dock this weapon at! Aborting\n"); 232 return ;234 return false; 233 235 } 234 236 } … … 239 241 PRINTF(2)("Unable to add Weapon with wrong capatibility to Slot %d (W:%d M:%d)\n", 240 242 slotID, weapon->getCapability(), this->currentSlotConfig[slotID].capability); 241 return ;243 return false; 242 244 } 243 245 … … 249 251 } 250 252 PRINTF(3)("Added a new Weapon to the WeaponManager: config %i/ slot %i\n", configID, slotID); 253 return true; 251 254 } 252 255 -
trunk/src/world_entities/weapons/weapon_manager.h
r6512 r6561 71 71 PNode* getParent() const { return this->parent; }; 72 72 73 void addWeapon(Weapon* weapon, int configID = -1, int slotID = -1); 73 bool addWeapon(Weapon* weapon); 74 bool addWeapon(Weapon* weapon, int configID = -1, int slotID = -1); 74 75 void removeWeapon(Weapon* weapon, int configID = -1); 75 76 Weapon* getWeapon(int slotID) const { return (slotID >= 0 && slotID < this->slotCount)? this->currentSlotConfig[slotID].nextWeapon: NULL; };
Note: See TracChangeset
for help on using the changeset viewer.