CvPlot::getLatitude() const
- Defined in
- CvPlot.cpp, line 4565
- Class
- CvPlot
- Hook name
CivHooks::CvPlot_getLatitude
Hooks
static bool BeforeCvPlot_getLatitude(const CvPlot* self, int& result);static void AfterCvPlot_getLatitude(const CvPlot* self, int& result);static int ReplaceCvPlot_getLatitude(int (*original)(const CvPlot*), const CvPlot* self);CivRegisterBefore<CivHooks::CvPlot_getLatitude>(host, &BeforeCvPlot_getLatitude);CivRegisterAfter<CivHooks::CvPlot_getLatitude>(host, &AfterCvPlot_getLatitude);CivRegisterReplace<CivHooks::CvPlot_getLatitude>(host, &ReplaceCvPlot_getLatitude);
Code
4565int CvPlot::getLatitude() const4566{4567 int iLatitude;45684569 if(GC.getMap().isWrapX() || !(GC.getMap().isWrapY()))4570 {4571 iLatitude = ((getY() * 100) / GC.getMap().getGridHeight());4572 }4573 else4574 {4575 iLatitude = ((getX() * 100) / GC.getMap().getGridWidth());4576 }45774578 iLatitude = ((iLatitude * (GC.getMap().getTopLatitude() - GC.getMap().getBottomLatitude())) / 100);45794580 return abs(iLatitude + GC.getMap().getBottomLatitude());4581}