Bazaar developer reference

CvDiplomacyAI::DoPlayerBulliedSomeone(PlayerTypes, PlayerTypes)

Defined in
CvDiplomacyAI.cpp, line 9854
Class
CvDiplomacyAI
Hook name
CivHooks::CvDiplomacyAI_DoPlayerBulliedSomeone

Hooks

static bool BeforeCvDiplomacyAI_DoPlayerBulliedSomeone(CvDiplomacyAI* self, PlayerTypes ePlayer, PlayerTypes eOtherPlayer);static void AfterCvDiplomacyAI_DoPlayerBulliedSomeone(CvDiplomacyAI* self, PlayerTypes ePlayer, PlayerTypes eOtherPlayer);static void ReplaceCvDiplomacyAI_DoPlayerBulliedSomeone(void (*original)(CvDiplomacyAI*, PlayerTypes, PlayerTypes), CvDiplomacyAI* self, PlayerTypes ePlayer, PlayerTypes eOtherPlayer);CivRegisterBefore<CivHooks::CvDiplomacyAI_DoPlayerBulliedSomeone>(host, &BeforeCvDiplomacyAI_DoPlayerBulliedSomeone);CivRegisterAfter<CivHooks::CvDiplomacyAI_DoPlayerBulliedSomeone>(host, &AfterCvDiplomacyAI_DoPlayerBulliedSomeone);CivRegisterReplace<CivHooks::CvDiplomacyAI_DoPlayerBulliedSomeone>(host, &ReplaceCvDiplomacyAI_DoPlayerBulliedSomeone);

Code

9853/// ePlayer bullied eOtherPlayer, so figure out what that means9854void CvDiplomacyAI::DoPlayerBulliedSomeone(PlayerTypes ePlayer, PlayerTypes eOtherPlayer)9855{9856	CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index.  Please send Jon this with your last 5 autosaves and what changelist # you're playing.");9857	CvAssertMsg(ePlayer < MAX_CIV_PLAYERS, "DIPLOMACY_AI: Invalid Player Index.  Please send Jon this with your last 5 autosaves and what changelist # you're playing.");9858	CvAssertMsg(eOtherPlayer >= 0, "DIPLOMACY_AI: Invalid Player Index.  Please send Jon this with your last 5 autosaves and what changelist # you're playing.");9859	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.");98609861	// The bully was someone else9862	if(IsPlayerValid(ePlayer) && ePlayer != GetPlayer()->GetID())9863	{9864		if(GET_PLAYER(eOtherPlayer).isMinorCiv())9865		{9866			// Did they bully a Minor we're protecting?9867			if(GET_PLAYER(eOtherPlayer).GetMinorCivAI()->IsProtectedByMajor(GetPlayer()->GetID()))9868			{				9869				ChangeOtherPlayerNumProtectedMinorsBullied(ePlayer, 1);9870			}9871		}9872	}9873}

Calls

Called by