Changeset 2918 for code/branches/weapons/src/orxonox/objects/worldentities
- Timestamp:
 - Apr 18, 2009, 6:14:52 PM (17 years ago)
 - Location:
 - code/branches/weapons/src/orxonox/objects/worldentities
 - Files:
 - 
          
- 3 edited
 
- 
          ControllableEntity.h (modified) (1 diff)
 - 
          pawns/Pawn.cc (modified) (4 diffs)
 - 
          pawns/Pawn.h (modified) (2 diffs)
 
 
Legend:
- Unmodified
 - Added
 - Removed
 
- 
        
code/branches/weapons/src/orxonox/objects/worldentities/ControllableEntity.h
r2912 r2918 82 82 83 83 virtual void fire(unsigned int firemode) {} 84 virtual void reload() {} 84 85 85 86 virtual void boost() {}  - 
        
code/branches/weapons/src/orxonox/objects/worldentities/pawns/Pawn.cc
r2914 r2918 56 56 this->fire_ = 0x0; 57 57 this->firehack_ = 0x0; 58 this->bReload_ = false; 58 59 59 60 this->health_ = 0; … … 115 116 registerVariable(this->initialHealth_, variableDirection::toclient); 116 117 registerVariable(this->fire_, variableDirection::toserver); 118 registerVariable(this->bReload_, variableDirection::toserver); 117 119 } 118 120 … … 121 123 SUPER(Pawn, tick, dt); 122 124 123 if (this->weaponSystem_ )125 if (this->weaponSystem_ && GameMode::isMaster()) 124 126 { 125 127 for (unsigned int firemode = 0; firemode < WeaponSystem::MAX_FIRE_MODES; firemode++) 126 128 if (this->fire_ & WeaponSystem::getFiremodeMask(firemode)) 127 129 this->weaponSystem_->fire(firemode); 128 } 130 131 if (this->bReload_) 132 this->weaponSystem_->reload(); 133 } 134 129 135 this->fire_ = this->firehack_; 130 136 this->firehack_ = 0x0; 137 this->bReload_ = false; 131 138 132 139 if (this->health_ <= 0) … … 258 265 } 259 266 267 void Pawn::reload() 268 { 269 this->bReload_ = true; 270 } 271 260 272 void Pawn::postSpawn() 261 273 {  - 
        
code/branches/weapons/src/orxonox/objects/worldentities/pawns/Pawn.h
r2914 r2918 81 81 82 82 virtual void fire(unsigned int firemode); 83 virtual void reload(); 83 84 virtual void postSpawn(); 84 85 … … 131 132 unsigned int fire_; 132 133 unsigned int firehack_; 134 bool bReload_; 133 135 134 136 std::string spawnparticlesource_;  
Note: See TracChangeset
          for help on using the changeset viewer.
      


            






