Bazaar developer reference

CvGameDeals::DoCancelAllDealsWithPlayer(PlayerTypes)

Defined in
CvDealClasses.cpp, line 3163
Class
CvGameDeals
Hook name
CivHooks::CvGameDeals_DoCancelAllDealsWithPlayer

Hooks

static bool BeforeCvGameDeals_DoCancelAllDealsWithPlayer(CvGameDeals* self, PlayerTypes eCancelPlayer);static void AfterCvGameDeals_DoCancelAllDealsWithPlayer(CvGameDeals* self, PlayerTypes eCancelPlayer);static void ReplaceCvGameDeals_DoCancelAllDealsWithPlayer(void (*original)(CvGameDeals*, PlayerTypes), CvGameDeals* self, PlayerTypes eCancelPlayer);CivRegisterBefore<CivHooks::CvGameDeals_DoCancelAllDealsWithPlayer>(host, &BeforeCvGameDeals_DoCancelAllDealsWithPlayer);CivRegisterAfter<CivHooks::CvGameDeals_DoCancelAllDealsWithPlayer>(host, &AfterCvGameDeals_DoCancelAllDealsWithPlayer);CivRegisterReplace<CivHooks::CvGameDeals_DoCancelAllDealsWithPlayer>(host, &ReplaceCvGameDeals_DoCancelAllDealsWithPlayer);

Code

3162/// End EVERYONE's deals with eCancelPlayer (typically upon death)3163void CvGameDeals::DoCancelAllDealsWithPlayer(PlayerTypes eCancelPlayer)3164{3165	CvTeam* pCancelTeam = &GET_TEAM(GET_PLAYER(eCancelPlayer).getTeam());31663167	// Loop through first set of players3168	TeamTypes eTeam;3169	PlayerTypes ePlayer;3170	for(int iPlayerLoop = 0; iPlayerLoop < MAX_MAJOR_CIVS; iPlayerLoop++)3171	{3172		ePlayer = (PlayerTypes) iPlayerLoop;31733174		if(!GET_PLAYER(ePlayer).isEverAlive())3175		{3176			continue;3177		}31783179		if(ePlayer == eCancelPlayer)3180		{3181			continue;3182		}31833184		eTeam = GET_PLAYER(ePlayer).getTeam();31853186		if(pCancelTeam->isHasMet(eTeam))3187		{3188			DoCancelDealsBetweenPlayers(eCancelPlayer, ePlayer);3189		}3190	}3191}

Calls

Called by