Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 27, 2011, 9:21:29 PM (13 years ago)
Author:
jo
Message:

Yeay, works. The pickuping efficiency isn't as good as expected though.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/ai2/src/orxonox/controllers/AIController.cc

    r8791 r8792  
    241241                WorldEntity* wPoint = this->waypoints_[this->waypoints_.size()-1];
    242242                if(wPoint)
     243                {
    243244                    this->moveToPosition(wPoint->getWorldPosition()); //BUG ?? sometime wPoint->getWorldPosition() causes crash
    244                 if (wPoint->getWorldPosition().squaredDistance(controllable->getPosition()) <= this->squaredaccuracy_)
    245                     this->waypoints_.pop_back(); // if goal is reached, remove it from the list
     245                    if (wPoint->getWorldPosition().squaredDistance(controllable->getPosition()) <= this->squaredaccuracy_)
     246                        this->waypoints_.pop_back(); // if goal is reached, remove it from the list
     247                }
     248                else
     249                    this->waypoints_.pop_back(); // remove invalid waypoints
    246250
    247251            }
Note: See TracChangeset for help on using the changeset viewer.