- Timestamp:
- Oct 24, 2013, 12:41:13 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/orxonox/controllers/WaypointPatrolController.cc
r9667 r9716 42 42 RegisterObject(WaypointPatrolController); 43 43 44 this->alertnessradius_ = 500; 44 this->alertnessradius_ = 500.0f; 45 this->attackradius_ = 1000.0f; 45 46 46 47 this->patrolTimer_.setTimer(rnd(), true, createExecutor(createFunctor(&WaypointPatrolController::searchEnemy, this))); … … 52 53 53 54 XMLPortParam(WaypointPatrolController, "alertnessradius", setAlertnessRadius, getAlertnessRadius, xmlelement, mode).defaultValues(500.0f); 55 XMLPortParam(WaypointPatrolController, "attackradius", setAttackRadius, getAttackRadius, xmlelement, mode).defaultValues(1000.0f); 54 56 } 55 57 … … 59 61 return; 60 62 61 if (this->target_) 63 if (this->target_) //if there is a target, follow it and shoot it, if it is close enough 62 64 { 63 65 this->aimAtTarget(); … … 66 68 this->moveToTargetPosition(); 67 69 68 if (this->getControllableEntity() && this->isCloseAtTarget( 1000) && this->isLookingAtTarget(math::pi / 20.0f))70 if (this->getControllableEntity() && this->isCloseAtTarget(this->attackradius_) && this->isLookingAtTarget(math::pi / 20.0f)) 69 71 this->getControllableEntity()->fire(0); 70 72 }
Note: See TracChangeset
for help on using the changeset viewer.