diff --git a/source/glest_game/type_instances/unit.cpp b/source/glest_game/type_instances/unit.cpp index ccb4fbf3..ec03899d 100644 --- a/source/glest_game/type_instances/unit.cpp +++ b/source/glest_game/type_instances/unit.cpp @@ -37,6 +37,7 @@ namespace Glest{ namespace Game{ const int UnitPathBasic::maxBlockCount= GameConstants::updateFps / 2; const int updateUnitForStopCommandFrameCount = 40; +const bool updateUnitForStopCommandFrameCountEnabled = false; UnitPathBasic::UnitPathBasic() { this->blockCount = 0; @@ -1106,17 +1107,18 @@ bool Unit::needToUpdate() { if(newProgress >= 1.f) { return_value = true; - if(currSkill->getClass() != scDie) { - if(currSkill->getClass() == scStop) { - return_value = false; - uint32 framesSinceLastCheck = (game->getWorld()->getFrameCount() - this->getLastStopCommandCheckFrame()); - if(this->getLastStopCommandCheckFrame() <= 0 || - framesSinceLastCheck >= updateUnitForStopCommandFrameCount) { - return_value = true; + if(updateUnitForStopCommandFrameCountEnabled == true) { + if(currSkill->getClass() != scDie) { + if(currSkill->getClass() == scStop) { + return_value = false; + uint32 framesSinceLastCheck = (game->getWorld()->getFrameCount() - this->getLastStopCommandCheckFrame()); + if(this->getLastStopCommandCheckFrame() <= 0 || + framesSinceLastCheck >= updateUnitForStopCommandFrameCount) { + return_value = true; + } } } } - } } return return_value; @@ -1210,18 +1212,17 @@ bool Unit::update() { if(currSkill->getClass() != scDie) { progress = 0.f; return_value = true; - if(currSkill->getClass() == scStop && this->anyCommand() == false) { - return_value = false; - uint32 framesSinceLastCheck = (game->getWorld()->getFrameCount() - this->getLastStopCommandCheckFrame()); - if(this->getLastStopCommandCheckFrame() <= 0 || - framesSinceLastCheck >= updateUnitForStopCommandFrameCount) { - this->setLastStopCommandCheckFrame(game->getWorld()->getFrameCount()); - return_value = true; + if(updateUnitForStopCommandFrameCountEnabled == true) { + if(currSkill->getClass() == scStop && this->anyCommand() == false) { + return_value = false; + uint32 framesSinceLastCheck = (game->getWorld()->getFrameCount() - this->getLastStopCommandCheckFrame()); + if(this->getLastStopCommandCheckFrame() <= 0 || + framesSinceLastCheck >= updateUnitForStopCommandFrameCount) { + this->setLastStopCommandCheckFrame(game->getWorld()->getFrameCount()); + return_value = true; + } } } - //if(return_value == true) { - // printf("\n\n\n@@@@@@@@@@@@@@@ Unit [%s - %d] current skill [%s]\n",this->getFullName().c_str(),this->getId(),currSkill->getName().c_str()); - //} } else { progress= 1.f;