CvPlot::HasSpecialImprovement() const
- Defined in
- CvPlot.cpp, line 7107
- Class
- CvPlot
- Hook name
CivHooks::CvPlot_HasSpecialImprovement
Hooks
static bool BeforeCvPlot_HasSpecialImprovement(const CvPlot* self, bool& result);static void AfterCvPlot_HasSpecialImprovement(const CvPlot* self, bool& result);static bool ReplaceCvPlot_HasSpecialImprovement(bool (*original)(const CvPlot*), const CvPlot* self);CivRegisterBefore<CivHooks::CvPlot_HasSpecialImprovement>(host, &BeforeCvPlot_HasSpecialImprovement);CivRegisterAfter<CivHooks::CvPlot_HasSpecialImprovement>(host, &AfterCvPlot_HasSpecialImprovement);CivRegisterReplace<CivHooks::CvPlot_HasSpecialImprovement>(host, &ReplaceCvPlot_HasSpecialImprovement);
Code
7106/// Does this plot have a special improvement that we shouldn't remove?7107bool CvPlot::HasSpecialImprovement() const7108{7109 // Gifted improvements (if we are a minor civ)7110 if (getOwner() != NO_PLAYER)7111 {7112 CvPlayer* pOwner = &GET_PLAYER(getOwner());7113 if (pOwner->isMinorCiv())7114 {7115 if (IsImprovedByGiftFromMajor())7116 {7117 return true;7118 }7119 }7120 }71217122 // Great person improvements7123 ImprovementTypes eImprovement = getImprovementType();7124 if (eImprovement != NO_IMPROVEMENT)7125 {7126 CvImprovementEntry* pImprovementInfo = GC.getImprovementInfo(eImprovement);7127 if (pImprovementInfo && pImprovementInfo->IsCreatedByGreatPerson())7128 {7129 return true;7130 }7131 }71327133 return false;7134}