CvUnit::canCargoAllMove() const
- Defined in
- CvUnit.cpp, line 15392
- Class
- CvUnit
- Hook name
CivHooks::CvUnit_canCargoAllMove
Hooks
static bool BeforeCvUnit_canCargoAllMove(const CvUnit* self, bool& result);static void AfterCvUnit_canCargoAllMove(const CvUnit* self, bool& result);static bool ReplaceCvUnit_canCargoAllMove(bool (*original)(const CvUnit*), const CvUnit* self);CivRegisterBefore<CivHooks::CvUnit_canCargoAllMove>(host, &BeforeCvUnit_canCargoAllMove);CivRegisterAfter<CivHooks::CvUnit_canCargoAllMove>(host, &AfterCvUnit_canCargoAllMove);CivRegisterReplace<CivHooks::CvUnit_canCargoAllMove>(host, &ReplaceCvUnit_canCargoAllMove);
Code
15392bool CvUnit::canCargoAllMove() const15393{15394 VALIDATE_OBJECT15395 const IDInfo* pUnitNode;15396 const CvUnit* pLoopUnit;15397 CvPlot* pPlot;1539815399 pPlot = plot();1540015401 pUnitNode = pPlot->headUnitNode();1540215403 while(pUnitNode != NULL)15404 {15405 pLoopUnit = ::getUnit(*pUnitNode);15406 pUnitNode = pPlot->nextUnitNode(pUnitNode);1540715408 if(pLoopUnit && pLoopUnit->getTransportUnit() == this)15409 {15410 if(pLoopUnit->getDomainType() == DOMAIN_LAND)15411 {15412 if(!(pLoopUnit->canMove()))15413 {15414 return false;15415 }15416 }15417 }15418 }1541915420 return true;15421}