- Timestamp:
- Nov 1, 2013, 12:19:18 AM (11 years ago)
- Location:
- code/branches/levelKaan
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/levelKaan
- Property svn:mergeinfo changed
/code/trunk (added) merged: 9703,9716,9728-9730
- Property svn:mergeinfo changed
-
code/branches/levelKaan/src/orxonox/controllers/WaypointPatrolController.cc
r9667 r9733 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.