CvPlot::setRevealedOwner(TeamTypes, PlayerTypes)
- Defined in
- CvPlot.cpp, line 8932
- Class
- CvPlot
- Hook name
CivHooks::CvPlot_setRevealedOwner
Hooks
static bool BeforeCvPlot_setRevealedOwner(CvPlot* self, TeamTypes eTeam, PlayerTypes eNewValue, bool& result);static void AfterCvPlot_setRevealedOwner(CvPlot* self, TeamTypes eTeam, PlayerTypes eNewValue, bool& result);static bool ReplaceCvPlot_setRevealedOwner(bool (*original)(CvPlot*, TeamTypes, PlayerTypes), CvPlot* self, TeamTypes eTeam, PlayerTypes eNewValue);CivRegisterBefore<CivHooks::CvPlot_setRevealedOwner>(host, &BeforeCvPlot_setRevealedOwner);CivRegisterAfter<CivHooks::CvPlot_setRevealedOwner>(host, &AfterCvPlot_setRevealedOwner);CivRegisterReplace<CivHooks::CvPlot_setRevealedOwner>(host, &ReplaceCvPlot_setRevealedOwner);
Code
8932bool CvPlot::setRevealedOwner(TeamTypes eTeam, PlayerTypes eNewValue)8933{8934 CvAssertMsg(eTeam >= 0, "eTeam is expected to be non-negative (invalid Index)");8935 CvAssertMsg(eTeam < MAX_TEAMS, "eTeam is expected to be within maximum bounds (invalid Index)");89368937 if(getRevealedOwner(eTeam, false) != eNewValue)8938 {8939 m_aiRevealedOwner[eTeam] = eNewValue;89408941 // Let the team know we've found someone (if eNewValue IS someone)8942 if(eNewValue != NO_PLAYER)8943 {8944 GET_TEAM(eTeam).SetHasFoundPlayersTerritory(eNewValue, true);8945 }8946 return true;8947 }89488949 CvAssert(m_aiRevealedOwner[eTeam] == eNewValue);8950 return false;8951}