From f06f491e3f9a5c47b98ec136c8eee7789152ce32 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 1 May 2017 19:49:57 +0300 Subject: Remove ServerFeatures haveAttackDirections because it depend only on server type. --- src/being/being.cpp | 7 ++++--- src/being/localplayer.cpp | 4 +++- src/net/eathena/serverfeatures.cpp | 5 ----- src/net/eathena/serverfeatures.h | 2 -- src/net/serverfeatures.h | 2 -- src/net/tmwa/serverfeatures.cpp | 5 ----- src/net/tmwa/serverfeatures.h | 2 -- 7 files changed, 7 insertions(+), 20 deletions(-) diff --git a/src/being/being.cpp b/src/being/being.cpp index 6ed83429e..dfb337598 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -69,6 +69,7 @@ #include "net/gamehandler.h" #include "net/homunculushandler.h" #include "net/mercenaryhandler.h" +#include "net/net.h" #include "net/npchandler.h" #include "net/packetlimiter.h" #include "net/playerhandler.h" @@ -949,8 +950,7 @@ void Being::handleAttack(Being *restrict const victim, reset(); mActionTime = tick_time; - if (serverFeatures && - !serverFeatures->haveAttackDirections() && + if (Net::getNetworkType() == ServerType::TMWATHENA && this != localPlayer) { const uint8_t dir = calcDirection(victim->mX, @@ -1053,7 +1053,8 @@ void Being::handleSkill(Being *restrict const victim, reset(); mActionTime = tick_time; - if (!serverFeatures->haveAttackDirections() && this != localPlayer) + if (Net::getNetworkType() == ServerType::TMWATHENA && + this != localPlayer) { const uint8_t dir = calcDirection(victim->mX, victim->mY); diff --git a/src/being/localplayer.cpp b/src/being/localplayer.cpp index 3f31a7c15..81eb8f2c1 100644 --- a/src/being/localplayer.cpp +++ b/src/being/localplayer.cpp @@ -797,7 +797,8 @@ void LocalPlayer::attack(Being *const target, const bool keep, return; } - if (!serverFeatures->haveAttackDirections()) +#ifdef TMWA_SUPPORT + if (Net::getNetworkType() == ServerType::TMWATHENA) { if (abs(dist_y) >= abs(dist_x)) { @@ -814,6 +815,7 @@ void LocalPlayer::attack(Being *const target, const bool keep, setDirection(BeingDirection::LEFT); } } +#endif // TMWA_SUPPORT mActionTime = tick_time; diff --git a/src/net/eathena/serverfeatures.cpp b/src/net/eathena/serverfeatures.cpp index f5570b0a1..4b20bee56 100644 --- a/src/net/eathena/serverfeatures.cpp +++ b/src/net/eathena/serverfeatures.cpp @@ -116,11 +116,6 @@ bool ServerFeatures::haveCreateCharGender() const return serverVersion > 0; } -bool ServerFeatures::haveAttackDirections() const -{ - return true; -} - bool ServerFeatures::haveVending() const { return true; diff --git a/src/net/eathena/serverfeatures.h b/src/net/eathena/serverfeatures.h index 4e28684bd..53536c404 100644 --- a/src/net/eathena/serverfeatures.h +++ b/src/net/eathena/serverfeatures.h @@ -66,8 +66,6 @@ class ServerFeatures final : public Net::ServerFeatures bool haveCreateCharGender() const override final; - bool haveAttackDirections() const override final A_CONST; - bool haveVending() const override final A_CONST; bool haveCart() const override final A_CONST; diff --git a/src/net/serverfeatures.h b/src/net/serverfeatures.h index dbea1b5d5..a1a614743 100644 --- a/src/net/serverfeatures.h +++ b/src/net/serverfeatures.h @@ -68,8 +68,6 @@ class ServerFeatures notfinal virtual bool haveCreateCharGender() const = 0; - virtual bool haveAttackDirections() const = 0; - virtual bool haveVending() const = 0; virtual bool haveCart() const = 0; diff --git a/src/net/tmwa/serverfeatures.cpp b/src/net/tmwa/serverfeatures.cpp index b1a9c3feb..7a438db36 100644 --- a/src/net/tmwa/serverfeatures.cpp +++ b/src/net/tmwa/serverfeatures.cpp @@ -114,11 +114,6 @@ bool ServerFeatures::haveCreateCharGender() const return tmwServerVersion > 0x0f0b17; } -bool ServerFeatures::haveAttackDirections() const -{ - return false; -} - bool ServerFeatures::haveVending() const { return false; diff --git a/src/net/tmwa/serverfeatures.h b/src/net/tmwa/serverfeatures.h index 0fef3ce70..57b89a57d 100644 --- a/src/net/tmwa/serverfeatures.h +++ b/src/net/tmwa/serverfeatures.h @@ -66,8 +66,6 @@ class ServerFeatures final : public Net::ServerFeatures bool haveCreateCharGender() const override final; - bool haveAttackDirections() const override final A_CONST; - bool haveVending() const override final A_CONST; bool haveCart() const override final A_CONST; -- cgit v1.2.3-70-g09d2