Bazaar developer reference

CvPlot::isFriendlyCity(const CvUnit &, bool) const

Defined in
CvPlot.cpp, line 3722
Class
CvPlot
Hook name
CivHooks::CvPlot_isFriendlyCity

Hooks

static bool BeforeCvPlot_isFriendlyCity(const CvPlot* self, const CvUnit& kUnit, bool arg1, bool& result);static void AfterCvPlot_isFriendlyCity(const CvPlot* self, const CvUnit& kUnit, bool arg1, bool& result);static bool ReplaceCvPlot_isFriendlyCity(bool (*original)(const CvPlot*, const CvUnit&, bool), const CvPlot* self, const CvUnit& kUnit, bool arg1);CivRegisterBefore<CivHooks::CvPlot_isFriendlyCity>(host, &BeforeCvPlot_isFriendlyCity);CivRegisterAfter<CivHooks::CvPlot_isFriendlyCity>(host, &AfterCvPlot_isFriendlyCity);CivRegisterReplace<CivHooks::CvPlot_isFriendlyCity>(host, &ReplaceCvPlot_isFriendlyCity);

Code

3722bool CvPlot::isFriendlyCity(const CvUnit& kUnit, bool) const3723{3724	if(!getPlotCity())3725	{3726		return false;3727	}37283729	TeamTypes ePlotTeam = getTeam();37303731	if(NO_TEAM != ePlotTeam)3732	{3733		TeamTypes eTeam = GET_PLAYER(kUnit.getCombatOwner(ePlotTeam, *this)).getTeam();37343735		if(eTeam == ePlotTeam)3736		{3737			return true;3738		}37393740		if(GET_TEAM(ePlotTeam).IsAllowsOpenBordersToTeam(eTeam))3741		{3742			return true;3743		}3744	}37453746	return false;3747}

Calls

Called by