Bazaar developer reference

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

Called by