Bazaar developer reference

CvGoodyHuts::IsHasPlayerReceivedGoodyLately(PlayerTypes, GoodyTypes)

Defined in
CvGoodyHuts.cpp, line 48
Class
CvGoodyHuts
Hook name
CivHooks::CvGoodyHuts_IsHasPlayerReceivedGoodyLately

Hooks

static bool BeforeCvGoodyHuts_IsHasPlayerReceivedGoodyLately(PlayerTypes ePlayer, GoodyTypes eGoody, bool& result);static void AfterCvGoodyHuts_IsHasPlayerReceivedGoodyLately(PlayerTypes ePlayer, GoodyTypes eGoody, bool& result);static bool ReplaceCvGoodyHuts_IsHasPlayerReceivedGoodyLately(bool (*original)(PlayerTypes, GoodyTypes), PlayerTypes ePlayer, GoodyTypes eGoody);CivRegisterBefore<CivHooks::CvGoodyHuts_IsHasPlayerReceivedGoodyLately>(host, &BeforeCvGoodyHuts_IsHasPlayerReceivedGoodyLately);CivRegisterAfter<CivHooks::CvGoodyHuts_IsHasPlayerReceivedGoodyLately>(host, &AfterCvGoodyHuts_IsHasPlayerReceivedGoodyLately);CivRegisterReplace<CivHooks::CvGoodyHuts_IsHasPlayerReceivedGoodyLately>(host, &ReplaceCvGoodyHuts_IsHasPlayerReceivedGoodyLately);

Code

47/// Have we gotten this type of Goody lately? (in the last 3 Goodies, defined by NUM_GOODIES_REMEMBERED)48bool CvGoodyHuts::IsHasPlayerReceivedGoodyLately(PlayerTypes ePlayer, GoodyTypes eGoody)49{50	FAssert(ePlayer >= 0);51	FAssert(ePlayer < MAX_MAJOR_CIVS);52	FAssert(eGoody >= 0);53	//	FAssert(eGoody < DB.count("GoodyHuts"));5455	// Look at all of our Goody slots and see if the requested Goody matches anything56	for (int iGoodySlotLoop = 0; iGoodySlotLoop < NUM_GOODIES_REMEMBERED; iGoodySlotLoop++)57	{58		if (m_aaiPlayerGoodyHutResults[ePlayer][iGoodySlotLoop] == eGoody)59		{60			return true;61		}62	}6364	return false;65}

Called by