Bazaar developer reference

CvPlot::setOwnershipDuration(int)

Defined in
CvPlot.cpp, line 4755
Class
CvPlot
Hook name
CivHooks::CvPlot_setOwnershipDuration

Hooks

static bool BeforeCvPlot_setOwnershipDuration(CvPlot* self, int iNewValue);static void AfterCvPlot_setOwnershipDuration(CvPlot* self, int iNewValue);static void ReplaceCvPlot_setOwnershipDuration(void (*original)(CvPlot*, int), CvPlot* self, int iNewValue);CivRegisterBefore<CivHooks::CvPlot_setOwnershipDuration>(host, &BeforeCvPlot_setOwnershipDuration);CivRegisterAfter<CivHooks::CvPlot_setOwnershipDuration>(host, &AfterCvPlot_setOwnershipDuration);CivRegisterReplace<CivHooks::CvPlot_setOwnershipDuration>(host, &ReplaceCvPlot_setOwnershipDuration);

Code

4755void CvPlot::setOwnershipDuration(int iNewValue)4756{4757	bool bOldOwnershipScore;47584759	if(getOwnershipDuration() != iNewValue)4760	{4761		bOldOwnershipScore = isOwnershipScore();47624763		m_iOwnershipDuration = iNewValue;4764		CvAssert(getOwnershipDuration() >= 0);47654766		if(bOldOwnershipScore != isOwnershipScore())4767		{4768			if(isOwned())4769			{4770				if(!isWater())4771				{4772					GET_PLAYER(getOwner()).changeTotalLandScored((isOwnershipScore()) ? 1 : -1);4773				}4774			}4775		}4776	}4777}

Calls

Called by