From d7de4533368a36b77dbc2dbe21269690d8dc5ee5 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 18 May 2016 23:57:51 +0300 Subject: Fix random one tile desync in SMSG_BEING_MOVE3 packet. --- src/being/being.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/being/being.h') diff --git a/src/being/being.h b/src/being/being.h index 0386f3290..296038876 100644 --- a/src/being/being.h +++ b/src/being/being.h @@ -136,7 +136,18 @@ class Being notfinal : public ActorSprite, /** * Creates a path for the being from current position to ex and ey */ - void setDestination(const int dstX, const int dstY) restrict2; + void setDestination(const int dstX, + const int dstY) restrict2; + + void setCachedDestination(const int dstX, + const int dstY) restrict2 + { mCachedX = dstX; mCachedY = dstY; } + + int getCachedX() const A_WARN_UNUSED + { return mCachedX; } + + int getCachedY() const A_WARN_UNUSED + { return mCachedY; } /** * Returns the destination for this being. @@ -1170,6 +1181,8 @@ class Being notfinal : public ActorSprite, int mX; // position in tiles int mY; // position in tiles + int mCachedX; + int mCachedY; int mSortOffsetY; // caculated offset in pixels based on mPixelOffsetY int mPixelOffsetY; // tile height offset in pixels // calculated between tiles -- cgit v1.2.3-70-g09d2