Bazaar developer reference

CvDllPlayerColorInfo::DecrementReference()

Defined in
CvDllPlayerColorInfo.cpp, line 41
Class
CvDllPlayerColorInfo
Hook name
CivHooks::CvDllPlayerColorInfo_DecrementReference

Hooks

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

Code

41unsigned int CvDllPlayerColorInfo::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