Bazaar developer reference

CvFlavorRecipient::GetLatestFlavorValue(FlavorTypes, bool)

Defined in
CvFlavorManager.cpp, line 112
Class
CvFlavorRecipient
Hook name
CivHooks::CvFlavorRecipient_GetLatestFlavorValue

Hooks

static bool BeforeCvFlavorRecipient_GetLatestFlavorValue(CvFlavorRecipient* self, FlavorTypes eFlavor, bool bAllowNegative, int& result);static void AfterCvFlavorRecipient_GetLatestFlavorValue(CvFlavorRecipient* self, FlavorTypes eFlavor, bool bAllowNegative, int& result);static int ReplaceCvFlavorRecipient_GetLatestFlavorValue(int (*original)(CvFlavorRecipient*, FlavorTypes, bool), CvFlavorRecipient* self, FlavorTypes eFlavor, bool bAllowNegative);CivRegisterBefore<CivHooks::CvFlavorRecipient_GetLatestFlavorValue>(host, &BeforeCvFlavorRecipient_GetLatestFlavorValue);CivRegisterAfter<CivHooks::CvFlavorRecipient_GetLatestFlavorValue>(host, &AfterCvFlavorRecipient_GetLatestFlavorValue);CivRegisterReplace<CivHooks::CvFlavorRecipient_GetLatestFlavorValue>(host, &ReplaceCvFlavorRecipient_GetLatestFlavorValue);

Code

111/// LatestFlavorValue Accessor Function112int CvFlavorRecipient::GetLatestFlavorValue(FlavorTypes eFlavor, bool bAllowNegative)113{114	CvAssertMsg(eFlavor > -1, "Out of bounds.");115	CvAssertMsg(eFlavor < GC.getNumFlavorTypes(), "Out of bounds.");116117	if(m_piLatestFlavorValues[eFlavor] < 0 && !bAllowNegative)118	{119		return 0;120	}121122	return m_piLatestFlavorValues[eFlavor];123}

Called by