Bazaar developer reference

CvPlayer::IsAtWar() const

Defined in
CvPlayer.cpp, line 28258
Class
CvPlayer
Hook name
CivHooks::CvPlayer_IsAtWar

Hooks

static bool BeforeCvPlayer_IsAtWar(const CvPlayer* self, bool& result);static void AfterCvPlayer_IsAtWar(const CvPlayer* self, bool& result);static bool ReplaceCvPlayer_IsAtWar(bool (*original)(const CvPlayer*), const CvPlayer* self);CivRegisterBefore<CivHooks::CvPlayer_IsAtWar>(host, &BeforeCvPlayer_IsAtWar);CivRegisterAfter<CivHooks::CvPlayer_IsAtWar>(host, &AfterCvPlayer_IsAtWar);CivRegisterReplace<CivHooks::CvPlayer_IsAtWar>(host, &ReplaceCvPlayer_IsAtWar);

Code

28258bool CvPlayer::IsAtWar() const28259{28260	CvTeam& kTeam = GET_TEAM(getTeam());2826128262	for (int iTeam = 0; iTeam < (MAX_TEAMS-1); iTeam++) {28263		if (GET_TEAM((TeamTypes)iTeam).isAlive() && kTeam.isAtWar((TeamTypes)iTeam)) {28264			return true;28265		}28266	}2826728268	return false;28269}

Calls

Called by