- Timestamp:
- Feb 4, 2016, 11:54:04 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/modules/weapons/weaponmodes/EnergyDrink.cc
r11052 r11108 59 59 this->speed_ = 750.0f; 60 60 this->delay_ = 0.0f; 61 this->timerStarted_ = false; 61 62 this->setMunitionName("FusionMunition"); 63 this->setFireSound("sounds/Weapon_EnergyDrink.ogg"); 62 64 63 65 this->delayTimer_.setTimer(1.0f, false, createExecutor(createFunctor(&EnergyDrink::shot, this))); … … 93 95 void EnergyDrink::fire() 94 96 { 95 this->delayTimer_.startTimer(); 97 if (!timerStarted_) 98 { 99 this->delayTimer_.startTimer(); 100 this->timerStarted_ = true; 101 } 102 } 103 104 bool EnergyDrink::fire(float* reloadTime) 105 { 106 if (!timerStarted_) 107 { 108 return WeaponMode::fire(reloadTime); 109 } 110 111 return false; 96 112 } 97 113 … … 102 118 void EnergyDrink::shot() 103 119 { 120 this->timerStarted_ = false; 121 104 122 // Create the projectile 105 123 Projectile* projectile = new Projectile(this->getContext());
Note: See TracChangeset
for help on using the changeset viewer.