Bazaar developer reference

CvPlayer::UpdatePlots()

Defined in
CvPlayer.cpp, line 26336
Class
CvPlayer
Hook name
CivHooks::CvPlayer_UpdatePlots

Hooks

static bool BeforeCvPlayer_UpdatePlots(CvPlayer* self);static void AfterCvPlayer_UpdatePlots(CvPlayer* self);static void ReplaceCvPlayer_UpdatePlots(void (*original)(CvPlayer*), CvPlayer* self);CivRegisterBefore<CivHooks::CvPlayer_UpdatePlots>(host, &BeforeCvPlayer_UpdatePlots);CivRegisterAfter<CivHooks::CvPlayer_UpdatePlots>(host, &AfterCvPlayer_UpdatePlots);CivRegisterReplace<CivHooks::CvPlayer_UpdatePlots>(host, &ReplaceCvPlayer_UpdatePlots);

Code

26335/// This determines what plots the player has under control26336void CvPlayer::UpdatePlots(void)26337{26338	if(m_aiPlots.size() == 0)  // not been inited26339	{26340		return;26341	}2634226343	int iPlotIndex = 0;26344	int iMaxNumPlots = (int) m_aiPlots.size();26345	while(iPlotIndex < iMaxNumPlots && m_aiPlots[iPlotIndex] != -1)26346	{26347		m_aiPlots[iPlotIndex] = -1;26348		iPlotIndex++;26349	}2635026351	int iI;26352	CvPlot* pLoopPlot;26353	iPlotIndex = 0;26354	int iNumPlotsInEntireWorld = GC.getMap().numPlots();26355	for(iI = 0; iI < iNumPlotsInEntireWorld; iI++)26356	{26357		pLoopPlot = GC.getMap().plotByIndexUnchecked(iI);26358		if(pLoopPlot->getOwner() != m_eID)26359		{26360			continue;26361		}2636226363		m_aiPlots[iPlotIndex] = iI;26364		iPlotIndex++;26365	}26366}

Calls

Called by