CvMinorCivAI::CanMajorBullyGold(PlayerTypes)
- Defined in
- CvMinorCivAI.cpp, line 9341
- Class
- CvMinorCivAI
- Hook name
CivHooks::CvMinorCivAI_CanMajorBullyGold
Hooks
static bool BeforeCvMinorCivAI_CanMajorBullyGold(CvMinorCivAI* self, PlayerTypes ePlayer, bool& result);static void AfterCvMinorCivAI_CanMajorBullyGold(CvMinorCivAI* self, PlayerTypes ePlayer, bool& result);static bool ReplaceCvMinorCivAI_CanMajorBullyGold(bool (*original)(CvMinorCivAI*, PlayerTypes), CvMinorCivAI* self, PlayerTypes ePlayer);CivRegisterBefore<CivHooks::CvMinorCivAI_CanMajorBullyGold>(host, &BeforeCvMinorCivAI_CanMajorBullyGold);CivRegisterAfter<CivHooks::CvMinorCivAI_CanMajorBullyGold>(host, &AfterCvMinorCivAI_CanMajorBullyGold);CivRegisterReplace<CivHooks::CvMinorCivAI_CanMajorBullyGold>(host, &ReplaceCvMinorCivAI_CanMajorBullyGold);
Code
9341bool CvMinorCivAI::CanMajorBullyGold(PlayerTypes ePlayer)9342{9343 CvAssertMsg(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)");9344 CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)");9345 if(ePlayer < 0 || ePlayer >= MAX_MAJOR_CIVS) return false;93469347 // Can't bully us if we're dead!9348 if(!GetPlayer()->isAlive())9349 return false;93509351 int iScore = CalculateBullyMetric(ePlayer, /*bForUnit*/false);9352 return CanMajorBullyGold(ePlayer, iScore);9353}