summaryrefslogtreecommitdiff
path: root/src/net/tmwa
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/tmwa')
-rw-r--r--src/net/tmwa/playerhandler.cpp17
-rw-r--r--src/net/tmwa/playerhandler.h2
2 files changed, 19 insertions, 0 deletions
diff --git a/src/net/tmwa/playerhandler.cpp b/src/net/tmwa/playerhandler.cpp
index a881f9dd4..3e304e8da 100644
--- a/src/net/tmwa/playerhandler.cpp
+++ b/src/net/tmwa/playerhandler.cpp
@@ -28,6 +28,7 @@
#include "being/attributes.h"
#include "being/beingflag.h"
+#include "being/localplayer.h"
#include "gui/windows/statuswindow.h"
@@ -413,4 +414,20 @@ void PlayerHandler::processPlayerStatUpdate5(Net::MessageIn &msg)
BLOCK_END("PlayerHandler::processPlayerStatUpdate5")
}
+void PlayerHandler::processWalkResponse(Net::MessageIn &msg)
+{
+ BLOCK_START("PlayerHandler::processWalkResponse")
+ /*
+ * This client assumes that all walk messages succeed,
+ * and that the server will send a correction notice
+ * otherwise.
+ */
+ uint16_t srcX, srcY, dstX, dstY;
+ msg.readInt32(); // tick
+ msg.readCoordinatePair(srcX, srcY, dstX, dstY);
+ if (localPlayer)
+ localPlayer->setRealPos(dstX, dstY);
+ BLOCK_END("PlayerHandler::processWalkResponse")
+}
+
} // namespace TmwAthena
diff --git a/src/net/tmwa/playerhandler.h b/src/net/tmwa/playerhandler.h
index f70f59f58..a3e62ae10 100644
--- a/src/net/tmwa/playerhandler.h
+++ b/src/net/tmwa/playerhandler.h
@@ -62,6 +62,8 @@ class PlayerHandler final : public MessageHandler, public Ea::PlayerHandler
protected:
void processPlayerStatUpdate5(Net::MessageIn &msg);
+
+ static void processWalkResponse(Net::MessageIn &msg);
};
} // namespace TmwAthena