- Timestamp:
- Nov 25, 2015, 2:53:58 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/campaignHS15/src/orxonox/controllers/SectionController.cc
r10856 r10858 102 102 switch (myDivisionLeader_->getAction()) 103 103 { 104 // case Action::FLY: 105 // { 106 // // Vector3 targetRelativePosition = getFormationPosition(); 107 // // Quaternion orient = 108 // // this->myDivisionLeader_->getControllableEntity()->getWorldOrientation(); 109 // // Vector3 targetAbsolutePosition = 110 // // ((this->myDivisionLeader_->getControllableEntity()->getWorldPosition()) + 111 // // (orient* (targetRelativePosition))); 112 // // this->setAction (Action::FLY, targetAbsolutePosition, orient); 113 // break; 114 // } 115 // case Action::FIGHT: 116 // { 117 118 // // this->setAction (Action::FLY, targetAbsolutePosition, orient); 119 // break; 120 // } 104 case Action::FIGHT: 105 { 106 if (!this->hasTarget()) 107 { 108 this->chooseTarget(); 109 } 110 break; 111 } 112 case Action::FIGHTALL: 113 { 114 if (!this->hasTarget()) 115 { 116 this->chooseTarget(); 117 } 118 break; 119 } 120 case Action::ATTACK: 121 { 122 if (!this->hasTarget()) 123 { 124 this->chooseTarget(); 125 } 126 break; 127 } 121 128 default: 122 129 { … … 150 157 } 151 158 } 159 } 160 if (this->hasTarget()) 161 { 162 //----choose where to go---- 163 this->maneuver(); 164 //----fire if you can---- 165 this->bShooting_ = this->canFire(); 152 166 } 153 167 } … … 210 224 211 225 } 212 this->set Action (Action::FIGHT,orxonox_cast<ControllableEntity*>(target));226 this->setTarget (orxonox_cast<ControllableEntity*>(target)); 213 227 } 214 228 else
Note: See TracChangeset
for help on using the changeset viewer.