Bazaar developer reference

CvMinorCivAI::CanMajorGiftTileImprovementAtPlot(PlayerTypes, int, int)

Defined in
CvMinorCivAI.cpp, line 10138
Class
CvMinorCivAI
Hook name
CivHooks::CvMinorCivAI_CanMajorGiftTileImprovementAtPlot

Hooks

static bool BeforeCvMinorCivAI_CanMajorGiftTileImprovementAtPlot(CvMinorCivAI* self, PlayerTypes eMajor, int iPlotX, int iPlotY, bool& result);static void AfterCvMinorCivAI_CanMajorGiftTileImprovementAtPlot(CvMinorCivAI* self, PlayerTypes eMajor, int iPlotX, int iPlotY, bool& result);static bool ReplaceCvMinorCivAI_CanMajorGiftTileImprovementAtPlot(bool (*original)(CvMinorCivAI*, PlayerTypes, int, int), CvMinorCivAI* self, PlayerTypes eMajor, int iPlotX, int iPlotY);CivRegisterBefore<CivHooks::CvMinorCivAI_CanMajorGiftTileImprovementAtPlot>(host, &BeforeCvMinorCivAI_CanMajorGiftTileImprovementAtPlot);CivRegisterAfter<CivHooks::CvMinorCivAI_CanMajorGiftTileImprovementAtPlot>(host, &AfterCvMinorCivAI_CanMajorGiftTileImprovementAtPlot);CivRegisterReplace<CivHooks::CvMinorCivAI_CanMajorGiftTileImprovementAtPlot>(host, &ReplaceCvMinorCivAI_CanMajorGiftTileImprovementAtPlot);

Code

10137// Convenience wrapper function10138bool CvMinorCivAI::CanMajorGiftTileImprovementAtPlot(PlayerTypes eMajor, int iPlotX, int iPlotY)10139{10140	CvAssertMsg(eMajor >= 0, "eMajor is expected to be non-negative (invalid Index)");10141	CvAssertMsg(eMajor < MAX_MAJOR_CIVS, "eMajor is expected to be within maximum bounds (invalid Index)");10142	if(eMajor < 0 || eMajor >= MAX_MAJOR_CIVS) return false;1014310144	return (CanMajorGiftTileImprovement(eMajor) && IsLackingGiftableTileImprovementAtPlot(eMajor, iPlotX, iPlotY));10145}

Calls

Called by