Bazaar developer reference

CvPlayer::setStartingPlot(CvPlot *)

Defined in
CvPlayer.cpp, line 10175
Class
CvPlayer
Hook name
CivHooks::CvPlayer_setStartingPlot

Hooks

static bool BeforeCvPlayer_setStartingPlot(CvPlayer* self, CvPlot* pNewValue);static void AfterCvPlayer_setStartingPlot(CvPlayer* self, CvPlot* pNewValue);static void ReplaceCvPlayer_setStartingPlot(void (*original)(CvPlayer*, CvPlot*), CvPlayer* self, CvPlot* pNewValue);CivRegisterBefore<CivHooks::CvPlayer_setStartingPlot>(host, &BeforeCvPlayer_setStartingPlot);CivRegisterAfter<CivHooks::CvPlayer_setStartingPlot>(host, &AfterCvPlayer_setStartingPlot);CivRegisterReplace<CivHooks::CvPlayer_setStartingPlot>(host, &ReplaceCvPlayer_setStartingPlot);

Code

10175void CvPlayer::setStartingPlot(CvPlot* pNewValue)10176{10177	CvPlot* pOldStartingPlot;1017810179	pOldStartingPlot = getStartingPlot();1018010181	if(pOldStartingPlot != pNewValue)10182	{10183		if(pOldStartingPlot != NULL)10184		{10185			pOldStartingPlot->area()->changeNumStartingPlots(-1);10186		}1018710188		if(pNewValue == NULL)10189		{10190			m_iStartingX = INVALID_PLOT_COORD;10191			m_iStartingY = INVALID_PLOT_COORD;10192		}10193		else10194		{10195			m_iStartingX = pNewValue->getX();10196			m_iStartingY = pNewValue->getY();1019710198			getStartingPlot()->setStartingPlot(true);1019910200			CvArea* pArea = getStartingPlot()->area();10201			if(pArea != NULL)10202				pArea->changeNumStartingPlots(1);10203		}10204	}10205}

Calls

Called by