- Timestamp:
- Dec 7, 2015, 2:49:46 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/campaignHS15/src/orxonox/controllers/ActionpointController.cc
r10927 r10934 40 40 ActionpointController::ActionpointController(Context* context) : FightingController(context) 41 41 { 42 this->actionpointControllerId_ = 0; 43 ActionpointController::sTicks_ = 0; 44 ActionpointController::nextActionpointControllerId_ = 0; 42 45 this->ticks_ = 0; 43 46 this->bPatrolling_ = false; … … 48 51 parsedActionpoints_.clear(); 49 52 actionpoints_.clear(); 50 51 53 this->bTakenOver_ = false; 52 54 this->action_ = Action::NONE; … … 92 94 parsedActionpoints_.clear(); 93 95 actionpoints_.clear(); 94 ActionpointController::nextActionpointControllerId_--; 96 this->actionpointControllerId_ = 0; 97 /*ActionpointController::nextActionpointControllerId_--; 95 98 if (ActionpointController::nextActionpointControllerId_ < 0) 96 ActionpointController::nextActionpointControllerId_ = 0; 99 ActionpointController::nextActionpointControllerId_ = 0;*/ 97 100 } 98 101 void ActionpointController::tick(float dt) … … 121 124 this->action_ = Action::FIGHTALL; 122 125 } 126 //orxout (internal_error) << "first tick was called by id = " << this->actionpointControllerId_ << ", total = " << ActionpointController::nextActionpointControllerId_ << endl; 123 127 } 124 128 if (ActionpointController::sTicks_ == 1) 125 129 { 126 this->timeOffset_ = 0.0f;127 130 this->bActionCalled_ = false; 128 131 … … 152 155 return; 153 156 154 this->timeOffset_ += dt; 155 if (this->timeOffset_ >= 2.4f) 156 this->timeOffset_ = 0.0f; 157 157 158 if (timeout_ <= 0) 158 159 this->bFiredRocket_ = false; … … 163 164 if (this->timeout_ > 0 && this->bFiredRocket_) 164 165 { 165 this->timeout_ -= dt;166 --this->timeout_; 166 167 } 167 168 … … 188 189 if (!this || !this->getControllableEntity()) 189 190 return; 190 191 if (this->hasTarget() && ActionpointController::sTicks_ % (ActionpointController::nextActionpointControllerId_ + 1) == (this->actionpointControllerId_)) 191 /* orxout (internal_error) << "id = " << this->actionpointControllerId_ << ", in total # ids = " << ActionpointController::nextActionpointControllerId_ 192 << ", I " << (this->hasTarget() ? "have" : "don't have") << " a target, my team is " << this->getControllableEntity()->getTeam() << endl; 193 */ if (this->hasTarget() && ActionpointController::sTicks_ % (ActionpointController::nextActionpointControllerId_ + 1) == (this->actionpointControllerId_)) 192 194 { 193 195
Note: See TracChangeset
for help on using the changeset viewer.