Bazaar developer reference

CvMinorCivAI::GetMostRecentBullyForQuest() const

Defined in
CvMinorCivAI.cpp, line 5891
Class
CvMinorCivAI
Hook name
CivHooks::CvMinorCivAI_GetMostRecentBullyForQuest

Hooks

static bool BeforeCvMinorCivAI_GetMostRecentBullyForQuest(const CvMinorCivAI* self, PlayerTypes& result);static void AfterCvMinorCivAI_GetMostRecentBullyForQuest(const CvMinorCivAI* self, PlayerTypes& result);static PlayerTypes ReplaceCvMinorCivAI_GetMostRecentBullyForQuest(PlayerTypes (*original)(const CvMinorCivAI*), const CvMinorCivAI* self);CivRegisterBefore<CivHooks::CvMinorCivAI_GetMostRecentBullyForQuest>(host, &BeforeCvMinorCivAI_GetMostRecentBullyForQuest);CivRegisterAfter<CivHooks::CvMinorCivAI_GetMostRecentBullyForQuest>(host, &AfterCvMinorCivAI_GetMostRecentBullyForQuest);CivRegisterReplace<CivHooks::CvMinorCivAI_GetMostRecentBullyForQuest>(host, &ReplaceCvMinorCivAI_GetMostRecentBullyForQuest);

Code

5890// Returns the PlayerTypes enum of the most recent valid bully, NO_PLAYER if there isn't one5891PlayerTypes CvMinorCivAI::GetMostRecentBullyForQuest() const5892{5893	PlayerTypes eBully = NO_PLAYER;5894	int iTurn = -1;5895	for(int iPlayerLoop = 0; iPlayerLoop < MAX_MAJOR_CIVS; iPlayerLoop++)5896	{5897		// Bully must still be alive5898		if(!GET_PLAYER((PlayerTypes)iPlayerLoop).isAlive())5899			continue;59005901		if(m_aiTurnLastBullied[iPlayerLoop] > iTurn)5902		{5903			iTurn = m_aiTurnLastBullied[iPlayerLoop];5904			eBully = (PlayerTypes)iPlayerLoop;5905		}5906	}59075908	return eBully;5909}

Calls

Called by