From dd2b559ea0d467db7fec522a63a66a82c1415b36 Mon Sep 17 00:00:00 2001 From: Bertram Date: Tue, 2 Mar 2010 23:20:50 +0100 Subject: Move path finding related code to the Map class and small fixes. It permits two things: 1. It simplifies and demystifies Being::SetDestination() code. 2. It will permit to show the *real* calulated path when using the drawDebugPath feature for ManaServ. --- src/map.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/map.h') diff --git a/src/map.h b/src/map.h index 7b91b6bb..0832df93 100644 --- a/src/map.h +++ b/src/map.h @@ -271,6 +271,23 @@ class Map : public Properties */ const std::string *getFilename() const; + /** + * Check the current position against surrounding blocking tiles, and + * correct the position offset within tile when needed. + */ + Position checkNodeOffsets(int radius, unsigned char walkMask, + const Position &position) const; + Position checkNodeOffsets(int radius, unsigned char walkMask, + int x, int y) const + { return checkNodeOffsets(radius, walkMask, Position(x, y)); } + + /** + * Find a pixel path from one location to the next. + */ + Path findPixelPath(int startPixelX, int startPixelY, + int destPixelX, int destPixelY, + int radius, unsigned char walkmask, int maxCost = 20); + /** * Find a path from one location to the next. */ -- cgit v1.2.3-70-g09d2