diff options
author | Bertram <bertram@cegetel.net> | 2010-02-23 22:32:18 +0100 |
---|---|---|
committer | Bertram <bertram@cegetel.net> | 2010-02-23 22:32:18 +0100 |
commit | 3adb0710b9b0262b7d7a03aa687e78c232f04d06 (patch) | |
tree | 79577ee68ace01c3614cba57d12522bc0d2f07da /src/being.h | |
parent | 55bd286b4bea4445894a576d64f788d53863b499 (diff) | |
download | mana-3adb0710b9b0262b7d7a03aa687e78c232f04d06.tar.gz mana-3adb0710b9b0262b7d7a03aa687e78c232f04d06.tar.bz2 mana-3adb0710b9b0262b7d7a03aa687e78c232f04d06.tar.xz mana-3adb0710b9b0262b7d7a03aa687e78c232f04d06.zip |
Sanitized ManaServ movement protocol, by mainly moving code from LocalPlayer to Being.
This fixes some movement glitches under ManaServ and make the code much cleaner
even if it's not perfect enough yet.
First of all, many checks have been gathered in the Being::setDestination() calls.
Also, now all path nodes including destination are checked against surrounding
tiles to correct the path when necessary.
The LocalPlayer::nextTile() still needs to be reviewed and some checks are missing
but it's almost done :)
Diffstat (limited to 'src/being.h')
-rw-r--r-- | src/being.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/being.h b/src/being.h index 3b63b02d..5140717c 100644 --- a/src/being.h +++ b/src/being.h @@ -647,6 +647,15 @@ class Being : public Sprite, public ConfigListener Vector mDest; /**< destination coordinates. */ + /** + * Check the current position against surrounding + * blocking tiles, and correct the position offset within + * tile when needed. + */ + Position checkNodeOffsets(Position position); + Position checkNodeOffsets(int x, int y) + { return checkNodeOffsets(Position(x, y)); } + private: /** |