CvArmyAI::GetArea() const
- Defined in
- CvArmyAI.cpp, line 562
- Class
- CvArmyAI
- Hook name
CivHooks::CvArmyAI_GetArea
Hooks
static bool BeforeCvArmyAI_GetArea(const CvArmyAI* self, int& result);static void AfterCvArmyAI_GetArea(const CvArmyAI* self, int& result);static int ReplaceCvArmyAI_GetArea(int (*original)(const CvArmyAI*), const CvArmyAI* self);CivRegisterBefore<CivHooks::CvArmyAI_GetArea>(host, &BeforeCvArmyAI_GetArea);CivRegisterAfter<CivHooks::CvArmyAI_GetArea>(host, &AfterCvArmyAI_GetArea);CivRegisterReplace<CivHooks::CvArmyAI_GetArea>(host, &ReplaceCvArmyAI_GetArea);
Code
561/// Retrieve the army's current area562int CvArmyAI::GetArea() const563{564 // try to find what plot we are in565 CvPlot* pPlot = GC.getMap().plotCheckInvalid(m_iCurrentX, m_iCurrentY);566 if(pPlot != NULL)567 {568 return pPlot->getArea();569 }570 else571 {572 // since there is no plot return the invalid index573 return FFreeList::INVALID_INDEX;574 }575}