Bazaar developer reference

CvUnit::getCombatOwner(TeamTypes, const CvPlot &) const

Defined in
CvUnit.cpp, line 19667
Class
CvUnit
Hook name
CivHooks::CvUnit_getCombatOwner

Hooks

static bool BeforeCvUnit_getCombatOwner(const CvUnit* self, TeamTypes eForTeam, const CvPlot& whosePlot, PlayerTypes& result);static void AfterCvUnit_getCombatOwner(const CvUnit* self, TeamTypes eForTeam, const CvPlot& whosePlot, PlayerTypes& result);static PlayerTypes ReplaceCvUnit_getCombatOwner(PlayerTypes (*original)(const CvUnit*, TeamTypes, const CvPlot&), const CvUnit* self, TeamTypes eForTeam, const CvPlot& whosePlot);CivRegisterBefore<CivHooks::CvUnit_getCombatOwner>(host, &BeforeCvUnit_getCombatOwner);CivRegisterAfter<CivHooks::CvUnit_getCombatOwner>(host, &AfterCvUnit_getCombatOwner);CivRegisterReplace<CivHooks::CvUnit_getCombatOwner>(host, &ReplaceCvUnit_getCombatOwner);

Code

19667PlayerTypes CvUnit::getCombatOwner(TeamTypes eForTeam, const CvPlot& whosePlot) const19668{19669	VALIDATE_OBJECT19670	if(eForTeam != NO_TEAM && getTeam() != eForTeam && eForTeam != BARBARIAN_TEAM)19671	{19672		if(isAlwaysHostile(whosePlot))19673		{19674			return BARBARIAN_PLAYER;19675		}19676	}1967719678	return getOwner();19679}

Calls

Called by