Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 2, 2015, 10:31:23 AM (9 years ago)
Author:
gania
Message:

little fix

File:
1 edited

Legend:

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

    r10909 r10915  
    6868       
    6969        SUPER(WingmanController, tick, dt);
    70         if (this->timeOffset_ >= this->actionTime_ && this->timeOffset_ <= this->actionTime_ + 0.5f && !this->bActionCalled_)
    71         {
    72             this->action();
    73             this->bActionCalled_ = true;
    74         }
    75         if (this->timeOffset_ <= 0.5f)
    76         {
    77             this->bActionCalled_ = false;
    78         }
     70        if (!this->myLeader_)
     71        {
     72            if (this->actionTime_ == 2.0f)
     73            {
     74                if (this->timeOffset_ >= 0.0f && this->timeOffset_ <= 0.8f && !this->bActionCalled_)
     75                {
     76                    this->action();
     77                    this->bActionCalled_ = true;
     78                }
     79                if (this->timeOffset_ > 1.6f)
     80                {
     81                    this->bActionCalled_ = false;
     82                }
     83            }
     84            else
     85            {
     86                if (this->timeOffset_ > 0.8f && this->timeOffset_ <= 1.6f && !this->bActionCalled_)
     87                {
     88                    this->action();
     89                    this->bActionCalled_ = true;
     90                }
     91                if (this->timeOffset_ > 2.0f)
     92                {
     93                    this->bActionCalled_ = false;
     94                }
     95            }
     96        }
     97        else
     98        {
     99            if (this->timeOffset_ >= this->actionTime_ && this->timeOffset_ <= this->actionTime_ + 0.4f && !this->bActionCalled_)
     100            {
     101                this->action();
     102                this->bActionCalled_ = true;
     103            }
     104            if (this->timeOffset_ <= 0.5f)
     105            {
     106                this->bActionCalled_ = false;
     107            }
     108        }
     109       
     110
    79111    }
    80112   
     
    240272                if (closestLeader->getIdentifier()->getName() == "SectionController")
    241273                {
    242                     this->actionTime_ = 1.0f;
     274                    this->actionTime_ = 1.6f;
    243275                }
    244276                else
    245277                {
    246                     this->actionTime_ = 1.5f;
     278                    this->actionTime_ = 2.0f;
    247279                }
    248280                return closestLeader;
Note: See TracChangeset for help on using the changeset viewer.