Use method IsCoordValid() to replace explicit checks.

This commit is contained in:
megamage
2011-10-18 11:05:32 -04:00
parent c29ff41001
commit e0d933fed8
4 changed files with 19 additions and 15 deletions
+2 -2
View File
@@ -39,7 +39,7 @@ template<class T, class CONTAINER>
inline void
Cell::Visit(const CellCoord& standing_cell, TypeContainerVisitor<T, CONTAINER> &visitor, Map &m) const
{
if (standing_cell.x_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP || standing_cell.y_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP)
if (!standing_cell.IsCoordValid())
return;
uint16 district = (District)this->data.Part.reserved;
@@ -170,7 +170,7 @@ template<class T, class CONTAINER>
inline void
Cell::Visit(const CellCoord& standing_cell, TypeContainerVisitor<T, CONTAINER> &visitor, Map &m, float radius, float x_off, float y_off) const
{
if (standing_cell.x_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP || standing_cell.y_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP)
if (!standing_cell.IsCoordValid())
return;
//no jokes here... Actually placing ASSERT() here was good idea, but