Bazaar developer reference

CvDllPlayer::GetUnit(int)

Defined in
CvDllPlayer.cpp, line 286
Class
CvDllPlayer
Hook name
CivHooks::CvDllPlayer_GetUnit

Hooks

static bool BeforeCvDllPlayer_GetUnit(CvDllPlayer* self, int iID, ICvUnit1*& result);static void AfterCvDllPlayer_GetUnit(CvDllPlayer* self, int iID, ICvUnit1*& result);static ICvUnit1* ReplaceCvDllPlayer_GetUnit(ICvUnit1* (*original)(CvDllPlayer*, int), CvDllPlayer* self, int iID);// CivHooks.h gives this hook point no types, so nothing checks these hooks' parameters.host->RegisterHook(host->pluginIndex, CivHooks::CvDllPlayer_GetUnit::ID, CIV_HOOK_BEFORE, (void*)&BeforeCvDllPlayer_GetUnit);host->RegisterHook(host->pluginIndex, CivHooks::CvDllPlayer_GetUnit::ID, CIV_HOOK_AFTER, (void*)&AfterCvDllPlayer_GetUnit);host->RegisterHook(host->pluginIndex, CivHooks::CvDllPlayer_GetUnit::ID, CIV_HOOK_REPLACE, (void*)&ReplaceCvDllPlayer_GetUnit);

Code

286ICvUnit1* CvDllPlayer::GetUnit(int iID)287{288	CvUnit* pkUnit = m_pPlayer->getUnit(iID);289	if(pkUnit)290	{291		return new CvDllUnit(pkUnit);292	}293294	return NULL;295}

Calls