Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 7, 2015, 1:56:45 PM (10 years ago)
Author:
gania
Message:

fixed?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/campaignHS15/src/orxonox/controllers/ActionpointController.cc

    r10925 r10927  
    4242        this->ticks_ = 0;
    4343        this->bPatrolling_ = false;
    44         this->maneuverCounter_ = 0;
    4544        this->bInLoop_ = false;
    4645        this->bLoop_ = false;
     
    5554        this->bFirstTick_ = true;
    5655        this->bStartedDodging_ = false;
    57         this->timeDodged_ = 0;
    5856        this->bDefaultPatrol_ = true;
    5957        this->bDefaultFightAll_ = true;
     
    10098    void ActionpointController::tick(float dt)
    10199    {
    102         if (!this || !this->getControllableEntity())
     100        if (!this || !this->getControllableEntity() || !this->isActive())
    103101            return;
    104102        ++this->ticks_;
     
    113111            return;
    114112
    115         if (this->ticks_ == 1)
     113        if (ActionpointController::sTicks_ == 1)
    116114        {
    117115
     
    124122            }
    125123        }
    126         if (this->ticks_ == 1)
     124        if (ActionpointController::sTicks_ == 1)
    127125        {   
    128126            this->timeOffset_ = 0.0f;
     
    167165            this->timeout_ -= dt;
    168166        }
    169         if (this->bStartedDodging_)
    170         {
    171             this->timeDodged_ += dt;
    172         }
    173         maneuverCounter_ += dt;
     167   
    174168
    175169        if (!this || !this->getControllableEntity())
     
    177171        //maneuver every 0.25 sec ->
    178172        int step =  4;
     173        if (ActionpointController::sTicks_ % 100 <= 10)
     174        {
     175            this->bDodge_ = false;
     176        }
     177        else
     178        {
     179            this->bDodge_ = true;
     180        }
    179181        if (ActionpointController::sTicks_ % 100 == step * this->actionpointControllerId_ + 1)
    180182        {
     
    189191        if (this->hasTarget() &&  ActionpointController::sTicks_ % (ActionpointController::nextActionpointControllerId_ + 1) == (this->actionpointControllerId_))
    190192        {
    191             if (maneuverCounter_ > 6.0f)
    192                 this->maneuverCounter_ = 0;
    193             if (this->bStartedDodging_ &&  this->timeDodged_ > 4.0f)
    194             {
    195                 this->bStartedDodging_ = false;
    196                 this->timeDodged_ = 0;
    197             }
     193
     194         
    198195            if (!this || !this->getControllableEntity())
    199196                return;
Note: See TracChangeset for help on using the changeset viewer.