Buttons for client options

This commit is contained in:
Eduardo Bart
2013-02-06 17:35:59 -02:00
parent cf77df05ca
commit 7ece0ed8c7
11 changed files with 63 additions and 12 deletions

View File

@@ -166,7 +166,7 @@ public:
return Otc::InvalidDirection;
}
bool isMapPosition() const { return (x < 65535 && y < 65535 && z <= Otc::MAX_Z); }
bool isMapPosition() const { return (x >=0 && y >= 0 && z >= 0 && x < 65535 && y < 65535 && z <= Otc::MAX_Z); }
bool isValid() const { return !(x == 65535 && y == 65535 && z == 255); }
float distance(const Position& pos) const { return sqrt(pow((pos.x - x), 2) + pow((pos.y - y), 2)); }
int manhattanDistance(const Position& pos) const { return std::abs(pos.x - x) + std::abs(pos.y - y); }
@@ -226,9 +226,9 @@ public:
return false;
}
uint16 x;
uint16 y;
uint8 z;
int x;
int y;
short z;
};
struct PositionHasher : std::unary_function<Position, std::size_t> {