Bazaar developer reference

CvDllPlayerOptionInfo::DecrementReference()

Defined in
CvDllPlayerOptionInfo.cpp, line 41
Class
CvDllPlayerOptionInfo
Hook name
CivHooks::CvDllPlayerOptionInfo_DecrementReference

Hooks

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

Code

41unsigned int CvDllPlayerOptionInfo::DecrementReference()42{43	if(m_uiRefCount == 1)44	{45		delete this;46		return 0;47	}48	else49	{50		--m_uiRefCount;51		return m_uiRefCount;52	}53}

Called by