Bazaar developer reference

CvPlot::isWithinTeamCityRadius(TeamTypes, PlayerTypes) const

Defined in
CvPlot.cpp, line 1158
Class
CvPlot
Hook name
CivHooks::CvPlot_isWithinTeamCityRadius

Hooks

static bool BeforeCvPlot_isWithinTeamCityRadius(const CvPlot* self, TeamTypes eTeam, PlayerTypes eIgnorePlayer, bool& result);static void AfterCvPlot_isWithinTeamCityRadius(const CvPlot* self, TeamTypes eTeam, PlayerTypes eIgnorePlayer, bool& result);static bool ReplaceCvPlot_isWithinTeamCityRadius(bool (*original)(const CvPlot*, TeamTypes, PlayerTypes), const CvPlot* self, TeamTypes eTeam, PlayerTypes eIgnorePlayer);CivRegisterBefore<CivHooks::CvPlot_isWithinTeamCityRadius>(host, &BeforeCvPlot_isWithinTeamCityRadius);CivRegisterAfter<CivHooks::CvPlot_isWithinTeamCityRadius>(host, &AfterCvPlot_isWithinTeamCityRadius);CivRegisterReplace<CivHooks::CvPlot_isWithinTeamCityRadius>(host, &ReplaceCvPlot_isWithinTeamCityRadius);

Code

1158bool CvPlot::isWithinTeamCityRadius(TeamTypes eTeam, PlayerTypes eIgnorePlayer) const1159{1160	int iI;11611162	for(iI = 0; iI < MAX_PLAYERS; ++iI)1163	{1164		if(GET_PLAYER((PlayerTypes)iI).isAlive())1165		{1166			if(GET_PLAYER((PlayerTypes)iI).getTeam() == eTeam)1167			{1168				if((eIgnorePlayer == NO_PLAYER) || (((PlayerTypes)iI) != eIgnorePlayer))1169				{1170					if(isPlayerCityRadius((PlayerTypes)iI))1171					{1172						return true;1173					}1174				}1175			}1176		}1177	}11781179	return false;1180}

Calls

Called by