CvUnit::canGoldenAge(const CvPlot *, bool) const
- Defined in
- CvUnit.cpp, line 9945
- Class
- CvUnit
- Hook name
CivHooks::CvUnit_canGoldenAge
Hooks
static bool BeforeCvUnit_canGoldenAge(const CvUnit* self, const CvPlot* pPlot, bool bTestVisible, bool& result);static void AfterCvUnit_canGoldenAge(const CvUnit* self, const CvPlot* pPlot, bool bTestVisible, bool& result);static bool ReplaceCvUnit_canGoldenAge(bool (*original)(const CvUnit*, const CvPlot*, bool), const CvUnit* self, const CvPlot* pPlot, bool bTestVisible);CivRegisterBefore<CivHooks::CvUnit_canGoldenAge>(host, &BeforeCvUnit_canGoldenAge);CivRegisterAfter<CivHooks::CvUnit_canGoldenAge>(host, &AfterCvUnit_canGoldenAge);CivRegisterReplace<CivHooks::CvUnit_canGoldenAge>(host, &ReplaceCvUnit_canGoldenAge);
Code
9945bool CvUnit::canGoldenAge(const CvPlot* pPlot, bool bTestVisible) const9946{9947 VALIDATE_OBJECT9948 if(!isGoldenAge())9949 {9950 return false;9951 }99529953 // If prophet has started spreading religion, can't do other functions9954 if(m_pUnitInfo->IsSpreadReligion())9955 {9956 if(GetReligionData()->GetSpreadsLeft() < m_pUnitInfo->GetReligionSpreads())9957 {9958 return false;9959 }9960 }99619962 // Things we test ONLY when we're going to try to perform this action RIGHT NOW9963 if(!bTestVisible)9964 {9965 // Must be in player's territory9966 if(pPlot->getOwner() != getOwner())9967 return false;9968 }99699970 return true;9971}