From d54c371ad9d3c8a019d7d6bdc0262cd352a06ae5 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 16 Sep 2014 18:33:24 +0300 Subject: Add server feature haveMove3. --- src/net/eathena/serverfeatures.cpp | 5 +++++ src/net/eathena/serverfeatures.h | 2 ++ src/net/serverfeatures.h | 2 ++ src/net/tmwa/beinghandler.cpp | 4 ++-- src/net/tmwa/serverfeatures.cpp | 5 +++++ src/net/tmwa/serverfeatures.h | 2 ++ 6 files changed, 18 insertions(+), 2 deletions(-) (limited to 'src/net') diff --git a/src/net/eathena/serverfeatures.cpp b/src/net/eathena/serverfeatures.cpp index 4cd9551cc..b0787cb40 100644 --- a/src/net/eathena/serverfeatures.cpp +++ b/src/net/eathena/serverfeatures.cpp @@ -97,4 +97,9 @@ bool ServerFeatures::haveServerIgnore() const return true; } +bool ServerFeatures::haveMove3() const +{ + return false; +} + } // namespace EAthena diff --git a/src/net/eathena/serverfeatures.h b/src/net/eathena/serverfeatures.h index 4fd393a95..045679659 100644 --- a/src/net/eathena/serverfeatures.h +++ b/src/net/eathena/serverfeatures.h @@ -59,6 +59,8 @@ class ServerFeatures final : public Net::ServerFeatures bool haveChatChannels() const override final; bool haveServerIgnore() const override final; + + bool haveMove3() const override final; }; } // namespace EAthena diff --git a/src/net/serverfeatures.h b/src/net/serverfeatures.h index 1f36d6b42..b3ed6f4ff 100644 --- a/src/net/serverfeatures.h +++ b/src/net/serverfeatures.h @@ -56,6 +56,8 @@ class ServerFeatures notfinal virtual bool haveChatChannels() const = 0; virtual bool haveServerIgnore() const = 0; + + virtual bool haveMove3() const = 0; }; } // namespace Net diff --git a/src/net/tmwa/beinghandler.cpp b/src/net/tmwa/beinghandler.cpp index 321727e77..2bf3ed887 100644 --- a/src/net/tmwa/beinghandler.cpp +++ b/src/net/tmwa/beinghandler.cpp @@ -949,7 +949,7 @@ void BeingHandler::processPlayerMove(Net::MessageIn &msg) const void BeingHandler::processBeingMove3(Net::MessageIn &msg) { BLOCK_START("BeingHandler::processBeingMove3") - if (serverVersion < 10) + if (!Net::getServerFeatures()->haveMove3()) { BLOCK_END("BeingHandler::processBeingMove3") return; @@ -1377,7 +1377,7 @@ void BeingHandler::processBeingMove(Net::MessageIn &msg) { dstBeing->setAction(BeingAction::STAND, 0); dstBeing->setTileCoords(srcX, srcY); - if (serverVersion < 10) + if (!Net::getServerFeatures()->haveMove3()) dstBeing->setDestination(dstX, dstY); } diff --git a/src/net/tmwa/serverfeatures.cpp b/src/net/tmwa/serverfeatures.cpp index b5b5fc11c..7f60f139f 100644 --- a/src/net/tmwa/serverfeatures.cpp +++ b/src/net/tmwa/serverfeatures.cpp @@ -99,4 +99,9 @@ bool ServerFeatures::haveServerIgnore() const return tmwServerVersion == 0; } +bool ServerFeatures::haveMove3() const +{ + return serverVersion >= 10; +} + } // namespace TmwAthena diff --git a/src/net/tmwa/serverfeatures.h b/src/net/tmwa/serverfeatures.h index 3ae22ffb0..8444fd930 100644 --- a/src/net/tmwa/serverfeatures.h +++ b/src/net/tmwa/serverfeatures.h @@ -59,6 +59,8 @@ class ServerFeatures final : public Net::ServerFeatures bool haveChatChannels() const override final; bool haveServerIgnore() const override final; + + bool haveMove3() const override final; }; } // namespace TmwAthena -- cgit v1.2.3-60-g2f50