Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 20, 2005, 11:26:16 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: flush

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/world_entities/weapons/weapon.cc

    r4906 r4910  
    266266    // setting up for next action
    267267    this->currentState = WS_ACTIVATING;
    268     this->stateDuration = this->times[WA_ACTIVATE] + this->stateDuration;
     268    this->stateDuration = this->times[WS_ACTIVATING] + this->stateDuration;
    269269  }
    270270  this->requestedAction = WA_NONE;
     
    290290        // setting up for next action
    291291    this->currentState = WS_DEACTIVATING;
    292     this->stateDuration = this->times[WA_DEACTIVATE] + this->stateDuration;
     292    this->stateDuration = this->times[WS_DEACTIVATING] + this->stateDuration;
    293293  }
    294294  this->requestedAction = WA_NONE;
     
    314314    this->requestedAction = WA_NONE;
    315315    this->currentState = WS_CHARGING;
    316     this->stateDuration = this->times[WA_CHARGE] + this->stateDuration;
     316    this->stateDuration = this->times[WS_CHARGING] + this->stateDuration;
    317317  }
    318318  else // deactivate the Weapon if we do not have enough energy
     
    342342    this->energyLoaded -= this->minCharge;
    343343          // setting up for the next state
    344     this->stateDuration = this->times[WA_SHOOT] + this->stateDuration;
     344    this->stateDuration = this->times[WS_SHOOTING] + this->stateDuration;
    345345    this->currentState = WS_SHOOTING;
    346346    this->requestedAction = WA_NONE;
     
    390390  this->requestedAction = WA_NONE;
    391391  this->currentState = WS_RELOADING;
    392   this->stateDuration = this->times[WA_RELOAD] + this->stateDuration;
     392  this->stateDuration = this->times[WS_RELOADING] + this->stateDuration;
    393393
    394394}
     
    400400void Weapon::tickW(float dt)
    401401{
     402  printf("%s ", stateToChar(this->currentState));
     403
    402404  // setting up the timing properties
    403405  this->stateDuration -= dt;
     
    407409    if (this->stateDuration <= 0.0)
    408410    {
    409       if (unlikely (this->currentState != WS_DEACTIVATING))
     411      if (unlikely (this->currentState == WS_DEACTIVATING))
     412      {
     413        this->currentState = WS_INACTIVE;
     414        return;
     415      }
     416      else
    410417        this->currentState = WS_IDLE;
    411       else
    412         this->currentState = WS_INACTIVE;
    413418
    414419      if (this->requestedAction != WA_NONE)
Note: See TracChangeset for help on using the changeset viewer.