Bazaar developer reference

CvUnit::IsDoingPartialMove() const

Defined in
CvUnit.cpp, line 22270
Class
CvUnit
Hook name
CivHooks::CvUnit_IsDoingPartialMove

Hooks

static bool BeforeCvUnit_IsDoingPartialMove(const CvUnit* self, bool& result);static void AfterCvUnit_IsDoingPartialMove(const CvUnit* self, bool& result);static bool ReplaceCvUnit_IsDoingPartialMove(bool (*original)(const CvUnit*), const CvUnit* self);CivRegisterBefore<CivHooks::CvUnit_IsDoingPartialMove>(host, &BeforeCvUnit_IsDoingPartialMove);CivRegisterAfter<CivHooks::CvUnit_IsDoingPartialMove>(host, &AfterCvUnit_IsDoingPartialMove);CivRegisterReplace<CivHooks::CvUnit_IsDoingPartialMove>(host, &ReplaceCvUnit_IsDoingPartialMove);

Code

22270bool CvUnit::IsDoingPartialMove() const22271{22272	VALIDATE_OBJECT22273	const MissionQueueNode* pkMissionNode = HeadMissionQueueNode();22274	if(!pkMissionNode)22275	{22276		return false;22277	}2227822279	if(m_kLastPath.size() == 0)22280	{22281		return false;22282	}2228322284	CvPlot* pEndTurnPlot = GetPathEndTurnPlot();22285	CvPlot* pEndPathPlot = GetPathLastPlot();2228622287	if(plot() == pEndTurnPlot && plot() != pEndPathPlot && (pkMissionNode->iData1 == pEndPathPlot->getX() && pkMissionNode->iData2 == pEndPathPlot->getY()))22288	{22289		if(getMoves() < maxMoves() && getMoves() > 0)22290		{22291			return true;22292		}22293	}2229422295	return false;22296}

Calls

Called by