Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 25, 2015, 2:53:58 PM (8 years ago)
Author:
gania
Message:

should work, didn't compile

File:
1 edited

Legend:

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

    r10856 r10858  
    102102            switch (myDivisionLeader_->getAction())
    103103            {
    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                }
    121128                default:
    122129                {
     
    150157                    }
    151158                }
     159            }
     160            if (this->hasTarget())
     161            {
     162                //----choose where to go----
     163                this->maneuver();
     164                //----fire if you can----
     165                this->bShooting_ = this->canFire();               
    152166            }
    153167        }
     
    210224
    211225            }
    212             this->setAction (Action::FIGHT, orxonox_cast<ControllableEntity*>(target));
     226            this->setTarget (orxonox_cast<ControllableEntity*>(target));
    213227        }
    214228        else
Note: See TracChangeset for help on using the changeset viewer.