Bazaar developer reference

CvDllCombatInfo::DecrementReference()

Defined in
CvDllCombatInfo.cpp, line 43
Class
CvDllCombatInfo
Hook name
CivHooks::CvDllCombatInfo_DecrementReference

Hooks

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

Code

43unsigned int CvDllCombatInfo::DecrementReference()44{45	if(m_uiRefCount == 1)46	{47		delete this;48		return 0;49	}50	else51	{52		--m_uiRefCount;53		return m_uiRefCount;54	}55}

Called by