- Timestamp:
- May 26, 2016, 4:53:34 PM (8 years ago)
- Location:
- code/branches/presentationFS16
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentationFS16
- Property svn:mergeinfo changed
/code/branches/sagerjFS16 (added) merged: 11138,11142,11153,11164,11166,11170,11174-11175,11185,11189,11205
- Property svn:mergeinfo changed
-
code/branches/presentationFS16/src/orxonox/weaponsystem/Weapon.cc
r11071 r11208 99 99 Fire this Weapon with the the WeaponMode defined by @param mode 100 100 */ 101 void Weapon:: fire(unsigned int mode)101 void Weapon::push(unsigned int mode) 102 102 { 103 103 // To avoid firing with more than one mode at the same time, we lock the weapon (reloading) for … … 114 114 // Note: The reloading of each WeaponMode is internally handled by each A, B and C. 115 115 // The reloading of the weapon is only performed to avoid firing with different modes at the same time. 116 117 116 118 if (this->bReloading_ && this->reloadingWeaponmode_ != mode) 117 119 return; … … 123 125 { 124 126 float reloading_time = 0; 125 if (it->second->fire(&reloading_time)) 127 if (it->second->push(&reloading_time)) 128 { 129 this->bReloading_ = true; 130 this->reloadingWeaponmode_ = mode; 131 132 this->reloadTimer_.setInterval(reloading_time); 133 this->reloadTimer_.startTimer(); 134 } 135 } 136 } 137 138 void Weapon::release(unsigned int mode) 139 { 140 if (this->bReloading_ && this->reloadingWeaponmode_ != mode) 141 return; 142 143 std::multimap<unsigned int, WeaponMode*>::iterator start = this->weaponmodes_.lower_bound(mode); 144 std::multimap<unsigned int, WeaponMode*>::iterator end = this->weaponmodes_.upper_bound(mode); 145 146 for (std::multimap<unsigned int, WeaponMode*>::iterator it = start; it != end; ++it) 147 { 148 float reloading_time = 0; 149 if (it->second->release(&reloading_time)) 126 150 { 127 151 this->bReloading_ = true;
Note: See TracChangeset
for help on using the changeset viewer.