Changeset 6948
- Timestamp:
- May 21, 2010, 9:33:13 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/rocket/src/orxonox/controllers/NewHumanController.cc
r6905 r6948 359 359 Ogre::RaySceneQueryResult& result = rsq->execute(); 360 360 Pawn* pawn = orxonox_cast<Pawn*>(this->getControllableEntity()); 361 WorldEntity* myWe = static_cast<WorldEntity*>(this->getControllableEntity()); 361 362 362 363 Ogre::RaySceneQueryResult::iterator itr; 363 364 for (itr = result.begin(); itr != result.end(); ++itr) 364 365 { 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*/) 366 368 { 367 369 // Try to cast the user pointer 368 370 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 369 376 if (wePtr) 370 377 { … … 374 381 while (parent) 375 382 { 376 if (this->targetMask_.isExcluded(parent->getIdentifier()) )383 if (this->targetMask_.isExcluded(parent->getIdentifier()) || parent==myWe) 377 384 { 378 385 parent = parent->getParent(); … … 574 581 } 575 582 } 576 577 578 583 584 585 579 586 580 587
Note: See TracChangeset
for help on using the changeset viewer.