Bazaar developer reference

CvDiplomacyAI::IsAtWar(PlayerTypes)

Defined in
CvDiplomacyAI.cpp, line 25314
Class
CvDiplomacyAI
Hook name
CivHooks::CvDiplomacyAI_IsAtWar

Hooks

static bool BeforeCvDiplomacyAI_IsAtWar(CvDiplomacyAI* self, PlayerTypes eOtherPlayer, bool& result);static void AfterCvDiplomacyAI_IsAtWar(CvDiplomacyAI* self, PlayerTypes eOtherPlayer, bool& result);static bool ReplaceCvDiplomacyAI_IsAtWar(bool (*original)(CvDiplomacyAI*, PlayerTypes), CvDiplomacyAI* self, PlayerTypes eOtherPlayer);CivRegisterBefore<CivHooks::CvDiplomacyAI_IsAtWar>(host, &BeforeCvDiplomacyAI_IsAtWar);CivRegisterAfter<CivHooks::CvDiplomacyAI_IsAtWar>(host, &AfterCvDiplomacyAI_IsAtWar);CivRegisterReplace<CivHooks::CvDiplomacyAI_IsAtWar>(host, &ReplaceCvDiplomacyAI_IsAtWar);

Code

25313/// Helper function to determine if we're at war with a player25314bool CvDiplomacyAI::IsAtWar(PlayerTypes eOtherPlayer)25315{25316	CvAssertMsg(eOtherPlayer >= 0, "DIPLOMACY_AI: Invalid Player Index.  Please send Jon this with your last 5 autosaves and what changelist # you're playing.");25317	CvAssertMsg(eOtherPlayer < MAX_CIV_PLAYERS, "DIPLOMACY_AI: Invalid Player Index.  Please send Jon this with your last 5 autosaves and what changelist # you're playing.");2531825319	return GET_TEAM(GetTeam()).isAtWar(GET_PLAYER(eOtherPlayer).getTeam());25320}

Calls

Called by