CvTeam::isAtWarWithHumans() const
- Defined in
- CvTeam.cpp, line 6836
- Class
- CvTeam
- Hook name
CivHooks::CvTeam_isAtWarWithHumans
Hooks
static bool BeforeCvTeam_isAtWarWithHumans(const CvTeam* self, bool& result);static void AfterCvTeam_isAtWarWithHumans(const CvTeam* self, bool& result);static bool ReplaceCvTeam_isAtWarWithHumans(bool (*original)(const CvTeam*), const CvTeam* self);CivRegisterBefore<CivHooks::CvTeam_isAtWarWithHumans>(host, &BeforeCvTeam_isAtWarWithHumans);CivRegisterAfter<CivHooks::CvTeam_isAtWarWithHumans>(host, &AfterCvTeam_isAtWarWithHumans);CivRegisterReplace<CivHooks::CvTeam_isAtWarWithHumans>(host, &ReplaceCvTeam_isAtWarWithHumans);
Code
6836bool CvTeam::isAtWarWithHumans() const6837{//are we currently fighting a war with a human controlled civ?6838 for(int oppTeamIdx = 0; oppTeamIdx < MAX_TEAMS; ++oppTeamIdx)6839 {6840 CvTeam& oppTeam = GET_TEAM((TeamTypes)oppTeamIdx);6841 if(oppTeam.isAlive() && isAtWar((TeamTypes)oppTeamIdx) && oppTeam.isHuman())6842 {//we're at war with a human team6843 return true;6844 }6845 }6846 return false;6847}