Bazaar developer reference

CvPlayer::AddAPlot(CvPlot *)

Defined in
CvPlayer.cpp, line 26370
Class
CvPlayer
Hook name
CivHooks::CvPlayer_AddAPlot

Hooks

static bool BeforeCvPlayer_AddAPlot(CvPlayer* self, CvPlot* pPlot);static void AfterCvPlayer_AddAPlot(CvPlayer* self, CvPlot* pPlot);static void ReplaceCvPlayer_AddAPlot(void (*original)(CvPlayer*, CvPlot*), CvPlayer* self, CvPlot* pPlot);CivRegisterBefore<CivHooks::CvPlayer_AddAPlot>(host, &BeforeCvPlayer_AddAPlot);CivRegisterAfter<CivHooks::CvPlayer_AddAPlot>(host, &AfterCvPlayer_AddAPlot);CivRegisterReplace<CivHooks::CvPlayer_AddAPlot>(host, &ReplaceCvPlayer_AddAPlot);

Code

26369/// Adds a plot at the end of the list26370void CvPlayer::AddAPlot(CvPlot* pPlot)26371{26372	if(!pPlot)26373	{26374		return;26375	}2637626377	if(m_aiPlots.size() == 0)  // not been inited26378	{26379		return;26380	}2638126382	if(pPlot->getOwner() == m_eID)26383	{26384		return;26385	}2638626387	int iPlotIndex = 0;26388	int iMaxNumPlots = (int)m_aiPlots.size();26389	while(iPlotIndex < iMaxNumPlots && m_aiPlots[iPlotIndex] != -1)26390	{26391		iPlotIndex++;26392	}2639326394	m_aiPlots[iPlotIndex] = GC.getMap().plotNum(pPlot->getX(), pPlot->getY());2639526396}

Calls

Called by