summaryrefslogtreecommitdiff
path: root/src/net/tmwa
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-09-16 21:24:09 +0300
committerAndrei Karas <akaras@inbox.ru>2014-09-16 21:24:09 +0300
commitf91ad9a0c39ae1c537f2769f1fdf4b0a59e8bf91 (patch)
tree2a17b4d8c03215e89ddb00cea1595853fb61dde8 /src/net/tmwa
parent00a9e49121dfdd706607ceb35fc4dcba4ffbf80c (diff)
downloadplus-f91ad9a0c39ae1c537f2769f1fdf4b0a59e8bf91.tar.gz
plus-f91ad9a0c39ae1c537f2769f1fdf4b0a59e8bf91.tar.bz2
plus-f91ad9a0c39ae1c537f2769f1fdf4b0a59e8bf91.tar.xz
plus-f91ad9a0c39ae1c537f2769f1fdf4b0a59e8bf91.zip
add server feature haveMonsterAttackRange.
Diffstat (limited to 'src/net/tmwa')
-rw-r--r--src/net/tmwa/beinghandler.cpp6
-rw-r--r--src/net/tmwa/serverfeatures.cpp5
-rw-r--r--src/net/tmwa/serverfeatures.h2
3 files changed, 11 insertions, 2 deletions
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