Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 5, 2011, 11:59:37 PM (13 years ago)
Author:
jo
Message:

Further narrowing down. The bug is triggered, when a bot calls fire(3) - whenever a bot launches a rocket.

Location:
code/branches/ai2/src/orxonox/controllers
Files:
2 edited

Legend:

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

    r8732 r8733  
    230230                        this->moveToTargetPosition();
    231231
    232                     if (this->getControllableEntity() && this->bShooting_ && this->isCloseAtTarget(1000) && this->isLookingAtTarget(math::pi / 20.0f))
    233                         this->getControllableEntity()->fire(0);
     232                    this->doFire();
    234233                }
    235234
     
    267266                    this->moveToTargetPosition();
    268267
    269                 if (this->getControllableEntity() && this->bShooting_ && this->isCloseAtTarget(1000) && this->isLookingAtTarget(math::pi / 20.0f))
    270                     this->getControllableEntity()->fire(0);
     268                this->doFire();
    271269            }
    272270        }//END_OF DEFAULT MODE
  • code/branches/ai2/src/orxonox/controllers/ArtificialController.cc

    r8723 r8733  
    10491049            else if((weapons[3]==3)&& this->isCloseAtTarget(400) /*&&projectiles[3]*/ )
    10501050            {//ROCKET: mid range weapon
    1051                 //TODO: Which weapon is the rocket? How many rockets are available?
     1051                //TODO: How many rockets are available?
    10521052                this->mode_ = ROCKET;//Vector-implementation: mode_.push_back(ROCKET);
    1053                 this->getControllableEntity()->fire(3);//launch rocket
     1053                this->getControllableEntity()->fire(3);//launch rocket BUG IS TRIGGERED HERE.
    10541054                if(this->getControllableEntity()&&this->target_)//after fire(3) getControllableEntity() refers to the rocket!
    10551055                {
     
    10811081                for(unsigned int i=0; i<WeaponSystem::MAX_WEAPON_MODES; i++)
    10821082                {
    1083                     const std::string wpn = getWeaponname(i, pawn); COUT(0)<<wpn<< std::endl;//Temporary debug info.
     1083                    //const std::string wpn = getWeaponname(i, pawn); COUT(0)<<wpn<< std::endl;//Temporary debug info.
    10841084                    /*if(wpn=="")
    10851085                        weapons[i]=-1;
Note: See TracChangeset for help on using the changeset viewer.