CvCity::conscript()
- Defined in
- CvCity.cpp, line 6213
- Class
- CvCity
- Hook name
CivHooks::CvCity_conscript
Hooks
static bool BeforeCvCity_conscript(CvCity* self);static void AfterCvCity_conscript(CvCity* self);static void ReplaceCvCity_conscript(void (*original)(CvCity*), CvCity* self);CivRegisterBefore<CivHooks::CvCity_conscript>(host, &BeforeCvCity_conscript);CivRegisterAfter<CivHooks::CvCity_conscript>(host, &AfterCvCity_conscript);CivRegisterReplace<CivHooks::CvCity_conscript>(host, &ReplaceCvCity_conscript);
Code
6213void CvCity::conscript()6214{6215 VALIDATE_OBJECT6216 if(!canConscript())6217 {6218 return;6219 }62206221 changePopulation(-(getConscriptPopulation()));62226223 setDrafted(true);62246225 GET_PLAYER(getOwner()).changeConscriptCount(1);62266227 CvUnit* pUnit = initConscriptedUnit();6228 CvAssertMsg(pUnit != NULL, "pUnit expected to be assigned (not NULL)");62296230 if(NULL != pUnit)6231 {6232 if(GC.getGame().getActivePlayer() == getOwner())6233 {6234 auto_ptr<ICvUnit1> pDllUnit = GC.WrapUnitPointer(pUnit);6235 DLLUI->selectUnit(pDllUnit.get(), true, false, true);6236 }6237 }6238}
Calls
- CvCity::canConscript() const
- CvCity::changePopulation(int, bool)
- CvCity::getConscriptPopulation() const
- CvCity::getOwner() const
- CvCity::initConscriptedUnit()
- CvCity::setDrafted(bool)
- CvGame::getActivePlayer() const
- CvGlobals::GetEngineUserInterface()
- CvGlobals::getGame()
- CvGlobals::WrapUnitPointer(CvUnit *)
- CvPlayer::changeConscriptCount(int)
- CvPlayerAI::getPlayer(PlayerTypes)
ICvUserInterface1::selectUnitstd::auto_ptr::auto_ptrstd::auto_ptr::getstd::auto_ptr::operator auto_ptr_ref