CvTeam::SetNumTurnsLockedIntoWar(TeamTypes, int)
- Defined in
- CvTeam.cpp, line 3975
- Class
- CvTeam
- Hook name
CivHooks::CvTeam_SetNumTurnsLockedIntoWar
Hooks
static bool BeforeCvTeam_SetNumTurnsLockedIntoWar(CvTeam* self, TeamTypes eTeam, int iValue);static void AfterCvTeam_SetNumTurnsLockedIntoWar(CvTeam* self, TeamTypes eTeam, int iValue);static void ReplaceCvTeam_SetNumTurnsLockedIntoWar(void (*original)(CvTeam*, TeamTypes, int), CvTeam* self, TeamTypes eTeam, int iValue);CivRegisterBefore<CivHooks::CvTeam_SetNumTurnsLockedIntoWar>(host, &BeforeCvTeam_SetNumTurnsLockedIntoWar);CivRegisterAfter<CivHooks::CvTeam_SetNumTurnsLockedIntoWar>(host, &AfterCvTeam_SetNumTurnsLockedIntoWar);CivRegisterReplace<CivHooks::CvTeam_SetNumTurnsLockedIntoWar>(host, &ReplaceCvTeam_SetNumTurnsLockedIntoWar);
Code
3974/// How long are we locked into a war with eTeam?3975void CvTeam::SetNumTurnsLockedIntoWar(TeamTypes eTeam, int iValue)3976{3977 CvAssertMsg(eTeam >= 0, "eIndex is expected to be non-negative (invalid Index)");3978 CvAssertMsg(eTeam < MAX_TEAMS, "eIndex is expected to be within maximum bounds (invalid Index)");3979 CvAssertMsg(iValue >= 0, "Num turns locked into war should always be 0 or greater. Please show Jon this and send your last 5 autosaves and what changelist # you were playing.");3980 CvAssertMsg(eTeam != GetID() || iValue == 0, "Team is setting locked war turns with itself!");3981 if(eTeam != GetID() || iValue == 0)3982 m_aiNumTurnsLockedIntoWar[eTeam] = iValue;3983}
Calls
- CvTeam::GetID() const
Firaxis::Array::operator[]