CvPlot::doTurn()
- Defined in
- CvPlot.cpp, line 414
- Class
- CvPlot
- Hook name
CivHooks::CvPlot_doTurn
Hooks
static bool BeforeCvPlot_doTurn(CvPlot* self);static void AfterCvPlot_doTurn(CvPlot* self);static void ReplaceCvPlot_doTurn(void (*original)(CvPlot*), CvPlot* self);CivRegisterBefore<CivHooks::CvPlot_doTurn>(host, &BeforeCvPlot_doTurn);CivRegisterAfter<CivHooks::CvPlot_doTurn>(host, &AfterCvPlot_doTurn);CivRegisterReplace<CivHooks::CvPlot_doTurn>(host, &ReplaceCvPlot_doTurn);
Code
414void CvPlot::doTurn()415{416#if defined(SHOW_PLOT_POPUP)417 m_fPopupDelay = 0.5;418#endif419420 if(isOwned())421 {422 changeOwnershipDuration(1);423 }424425 if(getImprovementType() != NO_IMPROVEMENT)426 {427 changeImprovementDuration(1);428 }429430 verifyUnitValidPlot();431432 // Clear world anchor433 SetWorldAnchor(NO_WORLD_ANCHOR);434435 // XXX436#ifdef _DEBUG437 {438 IDInfo* pUnitNode;439 CvUnit* pLoopUnit;440441 pUnitNode = headUnitNode();442443 while(pUnitNode != NULL)444 {445 pLoopUnit = GetPlayerUnit(*pUnitNode);446 pUnitNode = nextUnitNode(pUnitNode);447448 if(pLoopUnit)449 {450 CvAssertMsg(pLoopUnit->atPlot(*this), "pLoopUnit is expected to be at the current plot instance");451 if(!pLoopUnit->atPlot(*this))452 {453 removeUnit(pLoopUnit, true);454 }455 }456 }457 }458#endif459 // XXX460}