Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6948


Ignore:
Timestamp:
May 21, 2010, 9:33:13 AM (14 years ago)
Author:
scheusso
Message:

somes fixes/changes in NewHumanController

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/rocket/src/orxonox/controllers/NewHumanController.cc

    r6905 r6948  
    359359        Ogre::RaySceneQueryResult& result = rsq->execute();
    360360        Pawn* pawn = orxonox_cast<Pawn*>(this->getControllableEntity());
     361        WorldEntity* myWe = static_cast<WorldEntity*>(this->getControllableEntity());
    361362
    362363        Ogre::RaySceneQueryResult::iterator itr;
    363364        for (itr = result.begin(); itr != result.end(); ++itr)
    364365        {
    365             if (itr->movable->isInScene() && itr->movable->getMovableType() == "Entity" && itr->distance > 500)
     366//             CCOUT(0) << "testing object as target" << endl;
     367            if (itr->movable->isInScene() && itr->movable->getMovableType() == "Entity" /*&& itr->distance > 500*/)
    366368            {
    367369                // Try to cast the user pointer
    368370                WorldEntity* wePtr = dynamic_cast<WorldEntity*>(Ogre::any_cast<OrxonoxClass*>(itr->movable->getUserAny()));
     371               
     372                // make sure we don't shoot ourselves
     373                if( wePtr==myWe )
     374                    continue;
     375               
    369376                if (wePtr)
    370377                {
     
    374381                    while (parent)
    375382                    {
    376                         if (this->targetMask_.isExcluded(parent->getIdentifier()))
     383                        if (this->targetMask_.isExcluded(parent->getIdentifier()) || parent==myWe)
    377384                        {
    378385                            parent = parent->getParent();
     
    574581        }
    575582    }
    576                
    577 
    578        
     583       
     584
     585   
    579586
    580587
Note: See TracChangeset for help on using the changeset viewer.