CvPlot::getInlandCorner() const
- Defined in
- CvPlot.cpp, line 5170
- Class
- CvPlot
- Hook name
CivHooks::CvPlot_getInlandCorner
Hooks
static bool BeforeCvPlot_getInlandCorner(const CvPlot* self, CvPlot*& result);static void AfterCvPlot_getInlandCorner(const CvPlot* self, CvPlot*& result);static CvPlot* ReplaceCvPlot_getInlandCorner(CvPlot* (*original)(const CvPlot*), const CvPlot* self);CivRegisterBefore<CivHooks::CvPlot_getInlandCorner>(host, &BeforeCvPlot_getInlandCorner);CivRegisterAfter<CivHooks::CvPlot_getInlandCorner>(host, &AfterCvPlot_getInlandCorner);CivRegisterReplace<CivHooks::CvPlot_getInlandCorner>(host, &ReplaceCvPlot_getInlandCorner);
Code
5170CvPlot* CvPlot::getInlandCorner() const5171{5172 CvPlot* pRiverPlot = NULL; // will be a plot through whose SE corner we want the river to run5173 int aiShuffle[4];51745175 shuffleArray(aiShuffle, 4, GC.getGame().getMapRand());51765177 for(int iI = 0; iI < 4; ++iI)5178 {5179 switch(aiShuffle[iI])5180 {5181 case 0:5182 pRiverPlot = GC.getMap().plotCheckInvalid(getX(), getY());5183 break;5184 case 1:5185 pRiverPlot = plotDirection(getX(), getY(), DIRECTION_NORTH);5186 break;5187 case 2:5188 pRiverPlot = plotDirection(getX(), getY(), DIRECTION_NORTHWEST);5189 break;5190 case 3:5191 pRiverPlot = plotDirection(getX(), getY(), DIRECTION_WEST);5192 break;5193 }5194 if(pRiverPlot != NULL && !pRiverPlot->hasCoastAtSECorner())5195 {5196 break;5197 }5198 else5199 {5200 pRiverPlot = NULL;5201 }5202 }52035204 return pRiverPlot;5205}