diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-09-16 21:24:09 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-09-16 21:24:09 +0300 |
commit | f91ad9a0c39ae1c537f2769f1fdf4b0a59e8bf91 (patch) | |
tree | 2a17b4d8c03215e89ddb00cea1595853fb61dde8 /src | |
parent | 00a9e49121dfdd706607ceb35fc4dcba4ffbf80c (diff) | |
download | manaverse-f91ad9a0c39ae1c537f2769f1fdf4b0a59e8bf91.tar.gz manaverse-f91ad9a0c39ae1c537f2769f1fdf4b0a59e8bf91.tar.bz2 manaverse-f91ad9a0c39ae1c537f2769f1fdf4b0a59e8bf91.tar.xz manaverse-f91ad9a0c39ae1c537f2769f1fdf4b0a59e8bf91.zip |
add server feature haveMonsterAttackRange.
Diffstat (limited to 'src')
-rw-r--r-- | src/net/eathena/serverfeatures.cpp | 5 | ||||
-rw-r--r-- | src/net/eathena/serverfeatures.h | 2 | ||||
-rw-r--r-- | src/net/serverfeatures.h | 2 | ||||
-rw-r--r-- | src/net/tmwa/beinghandler.cpp | 6 | ||||
-rw-r--r-- | src/net/tmwa/serverfeatures.cpp | 5 | ||||
-rw-r--r-- | src/net/tmwa/serverfeatures.h | 2 |
6 files changed, 20 insertions, 2 deletions
diff --git a/src/net/eathena/serverfeatures.cpp b/src/net/eathena/serverfeatures.cpp index 9d6824ba2..d28b7a91c 100644 --- a/src/net/eathena/serverfeatures.cpp +++ b/src/net/eathena/serverfeatures.cpp @@ -112,4 +112,9 @@ bool ServerFeatures::haveOtherGender() const return false; } +bool ServerFeatures::haveMonsterAttackRange() const +{ + return false; +} + } // namespace EAthena diff --git a/src/net/eathena/serverfeatures.h b/src/net/eathena/serverfeatures.h index 036d3be4b..e4469868c 100644 --- a/src/net/eathena/serverfeatures.h +++ b/src/net/eathena/serverfeatures.h @@ -65,6 +65,8 @@ class ServerFeatures final : public Net::ServerFeatures bool haveItemColors() const override final; bool haveOtherGender() const override final; + + bool haveMonsterAttackRange() const override final; }; } // namespace EAthena diff --git a/src/net/serverfeatures.h b/src/net/serverfeatures.h index dcd777a03..803d81b81 100644 --- a/src/net/serverfeatures.h +++ b/src/net/serverfeatures.h @@ -62,6 +62,8 @@ class ServerFeatures notfinal virtual bool haveItemColors() const = 0; virtual bool haveOtherGender() const = 0; + + virtual bool haveMonsterAttackRange() const = 0; }; } // namespace Net diff --git a/src/net/tmwa/beinghandler.cpp b/src/net/tmwa/beinghandler.cpp index 398d582bd..f39b88979 100644 --- a/src/net/tmwa/beinghandler.cpp +++ b/src/net/tmwa/beinghandler.cpp @@ -1133,7 +1133,8 @@ void BeingHandler::processBeingVisible(Net::MessageIn &msg) msg.readInt16("manner"); dstBeing->setStatusEffectBlock(32, msg.readInt16("opt3")); - if (serverVersion > 0 && dstBeing->getType() == ActorType::Monster) + if (Net::getServerFeatures()->haveMonsterAttackRange() + && dstBeing->getType() == ActorType::Monster) { const int attackRange = static_cast<int>( msg.readUInt8("attack range (was karma)")); @@ -1336,7 +1337,8 @@ void BeingHandler::processBeingMove(Net::MessageIn &msg) msg.readInt16("manner"); dstBeing->setStatusEffectBlock(32, msg.readInt16("opt3")); - if (serverVersion > 0 && dstBeing->getType() == ActorType::Monster) + if (Net::getServerFeatures()->haveMonsterAttackRange() + && dstBeing->getType() == ActorType::Monster) { const int attackRange = static_cast<int>( msg.readUInt8("attack range (was karma)")); diff --git a/src/net/tmwa/serverfeatures.cpp b/src/net/tmwa/serverfeatures.cpp index e7d35b666..aaba467ac 100644 --- a/src/net/tmwa/serverfeatures.cpp +++ b/src/net/tmwa/serverfeatures.cpp @@ -114,4 +114,9 @@ bool ServerFeatures::haveOtherGender() const return serverVersion >= 5; } +bool ServerFeatures::haveMonsterAttackRange() const +{ + return serverVersion > 0; +} + } // namespace TmwAthena diff --git a/src/net/tmwa/serverfeatures.h b/src/net/tmwa/serverfeatures.h index 2af67f255..c5b3fddaa 100644 --- a/src/net/tmwa/serverfeatures.h +++ b/src/net/tmwa/serverfeatures.h @@ -65,6 +65,8 @@ class ServerFeatures final : public Net::ServerFeatures bool haveItemColors() const override final; bool haveOtherGender() const override final; + + bool haveMonsterAttackRange() const override final; }; } // namespace TmwAthena |