Bazaar developer reference

CvDllDealAI::DecrementReference()

Defined in
CvDllDealAI.cpp, line 44
Class
CvDllDealAI
Hook name
CivHooks::CvDllDealAI_DecrementReference

Hooks

static bool BeforeCvDllDealAI_DecrementReference(CvDllDealAI* self, unsigned int& result);static void AfterCvDllDealAI_DecrementReference(CvDllDealAI* self, unsigned int& result);static unsigned int ReplaceCvDllDealAI_DecrementReference(unsigned int (*original)(CvDllDealAI*), CvDllDealAI* self);// CivHooks.h gives this hook point no types, so nothing checks these hooks' parameters.host->RegisterHook(host->pluginIndex, CivHooks::CvDllDealAI_DecrementReference::ID, CIV_HOOK_BEFORE, (void*)&BeforeCvDllDealAI_DecrementReference);host->RegisterHook(host->pluginIndex, CivHooks::CvDllDealAI_DecrementReference::ID, CIV_HOOK_AFTER, (void*)&AfterCvDllDealAI_DecrementReference);host->RegisterHook(host->pluginIndex, CivHooks::CvDllDealAI_DecrementReference::ID, CIV_HOOK_REPLACE, (void*)&ReplaceCvDllDealAI_DecrementReference);

Code

44unsigned int CvDllDealAI::DecrementReference()45{46	if(m_uiRefCount == 1)47	{48		delete this;49		return 0;50	}51	else52	{53		--m_uiRefCount;54		return m_uiRefCount;55	}56}

Called by