Bazaar developer reference

CvAIOperationNukeAttack::FindBestFitReserveUnit(OperationSlot, CvPlot *, CvPlot *, bool *)

Defined in
CvAIOperation.cpp, line 5787
Class
CvAIOperationNukeAttack
Hook name
CivHooks::CvAIOperationNukeAttack_FindBestFitReserveUnit
Overrides
CvAIOperation::FindBestFitReserveUnit(OperationSlot, CvPlot *, CvPlot *, bool *)

Hooks

static bool BeforeCvAIOperationNukeAttack_FindBestFitReserveUnit(CvAIOperationNukeAttack* self, OperationSlot thisOperationSlot, CvPlot* arg1, CvPlot* arg2, bool* bRequired, bool& result);static void AfterCvAIOperationNukeAttack_FindBestFitReserveUnit(CvAIOperationNukeAttack* self, OperationSlot thisOperationSlot, CvPlot* arg1, CvPlot* arg2, bool* bRequired, bool& result);static bool ReplaceCvAIOperationNukeAttack_FindBestFitReserveUnit(bool (*original)(CvAIOperationNukeAttack*, OperationSlot, CvPlot*, CvPlot*, bool*), CvAIOperationNukeAttack* self, OperationSlot thisOperationSlot, CvPlot* arg1, CvPlot* arg2, bool* bRequired);CivRegisterBefore<CivHooks::CvAIOperationNukeAttack_FindBestFitReserveUnit>(host, &BeforeCvAIOperationNukeAttack_FindBestFitReserveUnit);CivRegisterAfter<CivHooks::CvAIOperationNukeAttack_FindBestFitReserveUnit>(host, &AfterCvAIOperationNukeAttack_FindBestFitReserveUnit);CivRegisterReplace<CivHooks::CvAIOperationNukeAttack_FindBestFitReserveUnit>(host, &ReplaceCvAIOperationNukeAttack_FindBestFitReserveUnit);

Code

5786/// Find a unit from our reserves that could serve in this operation5787bool CvAIOperationNukeAttack::FindBestFitReserveUnit(OperationSlot thisOperationSlot, CvPlot* /*pMusterPlot*/, CvPlot* /*pTargetPlot*/, bool* bRequired)5788{5789	// okay, this can be simplified to5790	*bRequired = true;5791	CvPlayerAI& ownerPlayer = GET_PLAYER(m_eOwner);5792	CvArmyAI* pThisArmy = ownerPlayer.getArmyAI(thisOperationSlot.m_iArmyID);5793	pThisArmy->AddUnit(m_iBestUnitID, thisOperationSlot.m_iSlotID);5794	return true;5795}

Calls