Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 24, 2005, 3:11:36 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: new Definitions in the WeaponManager-class

File:
1 edited

Legend:

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

    r4948 r4949  
    301301bool Weapon::deactivateW()
    302302{
    303   if (this->currentState != WS_INACTIVE)
     303//  if (this->currentState != WS_INACTIVE)
    304304  {
    305305    PRINTF(4)("Deactivating the Weapon %s\n", this->getName());
     
    403403inline void Weapon::enterState(WeaponState state)
    404404{
     405  PRINTF(3)("ENTERING STATE %s\n", stateToChar(state));
    405406  // playing animation if availiable
    406407  if (likely(this->animation[state] != NULL))
     
    427428  this->stateDuration -= dt;
    428429
    429   if (this->isActive())
    430   {
    431     if (this->stateDuration <= 0.0)
    432     {
    433       if (unlikely (this->currentState == WS_DEACTIVATING))
    434       {
    435         this->currentState = WS_INACTIVE;
    436         return;
    437       }
    438       else
    439         this->currentState = WS_IDLE;
    440 
    441       if (this->requestedAction != WA_NONE)
    442       {
    443         this->stateDuration = -dt;
    444         this->execute();
    445       }
     430  if (this->stateDuration <= 0.0)
     431  {
     432    if (unlikely (this->currentState == WS_DEACTIVATING))
     433    {
     434      this->currentState = WS_INACTIVE;
     435      return;
     436    }
     437    else
     438      this->currentState = WS_IDLE;
     439
     440    if (this->requestedAction != WA_NONE)
     441    {
     442      this->stateDuration = -dt;
     443      this->execute();
    446444    }
    447445  }
Note: See TracChangeset for help on using the changeset viewer.