Bazaar developer reference

CvDllBuildingInfo::DecrementReference()

Defined in
CvDllBuildingInfo.cpp, line 40
Class
CvDllBuildingInfo
Hook name
CivHooks::CvDllBuildingInfo_DecrementReference

Hooks

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

Code

40unsigned int CvDllBuildingInfo::DecrementReference()41{42	if(m_uiRefCount == 1)43	{44		delete this;45		return 0;46	}47	else48	{49		--m_uiRefCount;50		return m_uiRefCount;51	}52}

Called by