CvPlayer::changeNumMilitaryUnits(int)
- Defined in
- CvPlayer.cpp, line 15634
- Class
- CvPlayer
- Hook name
CivHooks::CvPlayer_changeNumMilitaryUnits
Hooks
static bool BeforeCvPlayer_changeNumMilitaryUnits(CvPlayer* self, int iChange);static void AfterCvPlayer_changeNumMilitaryUnits(CvPlayer* self, int iChange);static void ReplaceCvPlayer_changeNumMilitaryUnits(void (*original)(CvPlayer*, int), CvPlayer* self, int iChange);CivRegisterBefore<CivHooks::CvPlayer_changeNumMilitaryUnits>(host, &BeforeCvPlayer_changeNumMilitaryUnits);CivRegisterAfter<CivHooks::CvPlayer_changeNumMilitaryUnits>(host, &AfterCvPlayer_changeNumMilitaryUnits);CivRegisterReplace<CivHooks::CvPlayer_changeNumMilitaryUnits>(host, &ReplaceCvPlayer_changeNumMilitaryUnits);
Code
15634void CvPlayer::changeNumMilitaryUnits(int iChange)15635{15636 if(iChange != 0)15637 {15638 m_iNumMilitaryUnits = (m_iNumMilitaryUnits + iChange);15639 CvAssert(getNumMilitaryUnits() >= 0);1564015641 if(GetID() == GC.getGame().getActivePlayer())15642 {15643 GC.GetEngineUserInterface()->setDirty(GameData_DIRTY_BIT, true);15644 }15645 }15646}
Calls
- CvGame::getActivePlayer() const
- CvGlobals::GetEngineUserInterface()
- CvGlobals::getGame()
- CvPlayer::GetID() const
FAutoVariable::operator const int &FAutoVariable::operator=ICvUserInterface1::setDirty