- Timestamp:
- Nov 20, 2009, 5:20:11 PM (16 years ago)
- Location:
- code/branches/presentation2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation2
- Property svn:mergeinfo changed
/code/branches/particles2 (added) merged: 6050,6059,6065-6068,6076,6078-6082,6086-6087,6098-6099,6101
- Property svn:mergeinfo changed
-
code/branches/presentation2/src/orxonox/worldentities/pawns/Pawn.cc
r5929 r6107 52 52 CreateFactory(Pawn); 53 53 54 registerMemberNetworkFunction( Pawn, doFire );55 56 54 Pawn::Pawn(BaseObject* creator) : ControllableEntity(creator) 57 55 { … … 110 108 XMLPortObject(Pawn, WeaponSlot, "weaponslots", addWeaponSlot, getWeaponSlot, xmlelement, mode); 111 109 XMLPortObject(Pawn, WeaponSet, "weaponsets", addWeaponSet, getWeaponSet, xmlelement, mode); 112 XMLPortObject(Pawn, WeaponPack, "weapons", addWeaponPack , getWeaponPack, xmlelement, mode);110 XMLPortObject(Pawn, WeaponPack, "weapons", addWeaponPackXML, getWeaponPack, xmlelement, mode); 113 111 } 114 112 … … 263 261 } 264 262 265 void Pawn::fire(unsigned int firemode) 266 { 267 this->doFire(firemode); 268 } 269 270 void Pawn::doFire(uint8_t firemode) 271 { 272 if(GameMode::isMaster()) 273 { 274 if (this->weaponSystem_) 275 this->weaponSystem_->fire(firemode); 276 } 277 else 278 { 279 callMemberNetworkFunction(Pawn, doFire, this->getObjectID(), 0, firemode); 280 if (this->weaponSystem_) 281 this->weaponSystem_->fire(firemode); 282 } 263 void Pawn::fired(unsigned int firemode) 264 { 265 if (this->weaponSystem_) 266 this->weaponSystem_->fire(firemode); 283 267 } 284 268 … … 341 325 } 342 326 327 void Pawn::addWeaponPackXML(WeaponPack * wPack) 328 { 329 if (this->weaponSystem_) 330 if (!this->weaponSystem_->addWeaponPack(wPack)) 331 wPack->destroy(); 332 } 333 343 334 WeaponPack * Pawn::getWeaponPack(unsigned int index) const 344 335 {
Note: See TracChangeset
for help on using the changeset viewer.