- Timestamp:
- Jan 21, 2016, 1:59:04 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/orxonox/controllers/FightingController.cc
r11071 r11083 58 58 void FightingController::lookAtTarget(float dt) 59 59 { 60 if (!this || !this->getControllableEntity())60 if (!this->getControllableEntity()) 61 61 return; 62 62 ControllableEntity* entity = this->getControllableEntity(); … … 124 124 Vector3 diffUnit = diffVector/diffLength; 125 125 126 if (!this || !this->getControllableEntity())127 return;128 129 126 //too far? well, come closer then 130 127 if (diffLength > this->attackRange_) … … 142 139 this->bKeepFormation_ = false; 143 140 144 if (!this || !this->getControllableEntity())145 return;146 141 if (!this->bDodge_) 147 142 { … … 217 212 float FightingController::squaredDistanceToTarget() const 218 213 { 219 if (!this || !this->getControllableEntity())214 if (!this->getControllableEntity()) 220 215 return 0; 221 216 if (!this->target_ || !this->getControllableEntity()) … … 237 232 Pawn* FightingController::closestTarget() const 238 233 { 239 if (!this || !this->getControllableEntity())234 if (!this->getControllableEntity()) 240 235 return nullptr; 241 236
Note: See TracChangeset
for help on using the changeset viewer.