CvPlayer::changeMilitaryFoodProductionCount(int)
- Defined in
- CvPlayer.cpp, line 15761
- Class
- CvPlayer
- Hook name
CivHooks::CvPlayer_changeMilitaryFoodProductionCount
Hooks
static bool BeforeCvPlayer_changeMilitaryFoodProductionCount(CvPlayer* self, int iChange);static void AfterCvPlayer_changeMilitaryFoodProductionCount(CvPlayer* self, int iChange);static void ReplaceCvPlayer_changeMilitaryFoodProductionCount(void (*original)(CvPlayer*, int), CvPlayer* self, int iChange);CivRegisterBefore<CivHooks::CvPlayer_changeMilitaryFoodProductionCount>(host, &BeforeCvPlayer_changeMilitaryFoodProductionCount);CivRegisterAfter<CivHooks::CvPlayer_changeMilitaryFoodProductionCount>(host, &AfterCvPlayer_changeMilitaryFoodProductionCount);CivRegisterReplace<CivHooks::CvPlayer_changeMilitaryFoodProductionCount>(host, &ReplaceCvPlayer_changeMilitaryFoodProductionCount);
Code
15761void CvPlayer::changeMilitaryFoodProductionCount(int iChange)15762{15763 if(iChange != 0)15764 {15765 m_iMilitaryFoodProductionCount = (m_iMilitaryFoodProductionCount + iChange);15766 CvAssert(getMilitaryFoodProductionCount() >= 0);1576715768 if(getTeam() == GC.getGame().getActiveTeam())15769 {15770 GC.GetEngineUserInterface()->setDirty(CityInfo_DIRTY_BIT, true);15771 }15772 }15773}
Calls
- CvGame::getActiveTeam()
- CvGlobals::GetEngineUserInterface()
- CvGlobals::getGame()
- CvPlayer::getTeam() const
FAutoVariable::operator const int &FAutoVariable::operator=ICvUserInterface1::setDirty