- Timestamp:
- Nov 27, 2015, 4:42:14 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/campaignHS15/src/orxonox/controllers/ActionpointController.cc
r10875 r10877 31 31 #include "core/XMLPort.h" 32 32 #include <algorithm> 33 #include "worldentities/Actionpoint.h" 33 34 34 35 … … 38 39 RegisterClass(ActionpointController); 39 40 40 //CommonController contains all common functionality of AI Controllers41 41 ActionpointController::ActionpointController(Context* context) : FightingController(context) 42 42 { 43 43 this->bInLoop_ = false; 44 44 this->bLoop_ = false; 45 45 this->bEndLoop_ = false; … … 48 48 this->action_ = Action::NONE; 49 49 this->squaredaccuracy_ = 2500; 50 50 this->bFirstTick_ = true; 51 51 52 52 RegisterObject(ActionpointController); … … 559 559 if (this->action_ != Action::FIGHT && this->action_ != Action::FIGHTALL) 560 560 { 561 if ( (this->target_ && this->distance (this->getControllableEntity(), this->target_) > this->attackRange_)561 if ( (this->target_ && CommonController::distance (this->getControllableEntity(), this->target_) > this->attackRange_) 562 562 || !this->target_ ) 563 563 { 564 564 Pawn* newTarget = this->closestTarget(); 565 565 if ( newTarget && 566 this->distance (this->getControllableEntity(), static_cast<ControllableEntity*>(newTarget))566 CommonController::distance (this->getControllableEntity(), static_cast<ControllableEntity*>(newTarget)) 567 567 <= this->attackRange_ ) 568 568 { 569 Point p = { Action::FIGHT, this->getName(newTarget), Vector3::ZERO, false };569 Point p = { Action::FIGHT, CommonController::getName(newTarget), Vector3::ZERO, false }; 570 570 this->parsedActionpoints_.push_back(p); 571 571 this->executeActionpoint();
Note: See TracChangeset
for help on using the changeset viewer.