summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-05-01 00:37:40 +0300
committerAndrei Karas <akaras@inbox.ru>2017-05-01 00:37:40 +0300
commit79c393ec76891a806a69aad6782338875368e535 (patch)
treec55429deb61f25fb6acffdcd2bce40bbccbd936e /src
parent00509dd2dc2d0eed4b1ccc0788ab5b721deb7228 (diff)
downloadmv-79c393ec76891a806a69aad6782338875368e535.tar.gz
mv-79c393ec76891a806a69aad6782338875368e535.tar.bz2
mv-79c393ec76891a806a69aad6782338875368e535.tar.xz
mv-79c393ec76891a806a69aad6782338875368e535.zip
Remove ServerFeatures haveChangePartyLeader because it depend only on server type.
Diffstat (limited to 'src')
-rw-r--r--src/gui/widgets/tabs/chat/partytab.cpp7
-rw-r--r--src/net/eathena/serverfeatures.cpp5
-rw-r--r--src/net/eathena/serverfeatures.h2
-rw-r--r--src/net/serverfeatures.h2
-rw-r--r--src/net/tmwa/serverfeatures.cpp5
-rw-r--r--src/net/tmwa/serverfeatures.h2
6 files changed, 4 insertions, 19 deletions
diff --git a/src/gui/widgets/tabs/chat/partytab.cpp b/src/gui/widgets/tabs/chat/partytab.cpp
index 6602fc4b2..463cd81c0 100644
--- a/src/gui/widgets/tabs/chat/partytab.cpp
+++ b/src/gui/widgets/tabs/chat/partytab.cpp
@@ -34,6 +34,7 @@
#include "input/inputmanager.h"
+#include "net/net.h"
#include "net/partyhandler.h"
#include "net/serverfeatures.h"
@@ -100,8 +101,8 @@ bool PartyTab::handleCommand(const std::string &restrict type,
args,
this);
}
- else if (type == "setleader"
- && serverFeatures->haveChangePartyLeader())
+ else if (type == "setleader" &&
+ Net::getNetworkType() == ServerType::EATHENA)
{
inputManager.executeChatCommand(
InputAction::COMMAND_CHANGE_PARTY_LEADER,
@@ -135,7 +136,7 @@ void PartyTab::getAutoCompleteCommands(StringVect &names) const
names.push_back("/kick ");
names.push_back("/item");
names.push_back("/exp");
- if (serverFeatures->haveChangePartyLeader())
+ if (Net::getNetworkType() == ServerType::EATHENA)
names.push_back("/setleader ");
}
diff --git a/src/net/eathena/serverfeatures.cpp b/src/net/eathena/serverfeatures.cpp
index d1100882e..d787d0433 100644
--- a/src/net/eathena/serverfeatures.cpp
+++ b/src/net/eathena/serverfeatures.cpp
@@ -46,11 +46,6 @@ bool ServerFeatures::havePartyNickInvite() const
return true;
}
-bool ServerFeatures::haveChangePartyLeader() const
-{
- return true;
-}
-
bool ServerFeatures::haveServerHp() const
{
return true;
diff --git a/src/net/eathena/serverfeatures.h b/src/net/eathena/serverfeatures.h
index d0b113cd2..7b6f790fe 100644
--- a/src/net/eathena/serverfeatures.h
+++ b/src/net/eathena/serverfeatures.h
@@ -38,8 +38,6 @@ class ServerFeatures final : public Net::ServerFeatures
bool havePartyNickInvite() const override final A_CONST;
- bool haveChangePartyLeader() const override final A_CONST;
-
bool haveServerHp() const override final A_CONST;
bool havePlayerStatusUpdate() const override final;
diff --git a/src/net/serverfeatures.h b/src/net/serverfeatures.h
index 982fa2189..18cc10c42 100644
--- a/src/net/serverfeatures.h
+++ b/src/net/serverfeatures.h
@@ -40,8 +40,6 @@ class ServerFeatures notfinal
virtual bool havePartyNickInvite() const = 0;
- virtual bool haveChangePartyLeader() const = 0;
-
virtual bool haveServerHp() const = 0;
virtual bool havePlayerStatusUpdate() const = 0;
diff --git a/src/net/tmwa/serverfeatures.cpp b/src/net/tmwa/serverfeatures.cpp
index 0dd3f2a0a..40e51e30e 100644
--- a/src/net/tmwa/serverfeatures.cpp
+++ b/src/net/tmwa/serverfeatures.cpp
@@ -44,11 +44,6 @@ bool ServerFeatures::havePartyNickInvite() const
return false;
}
-bool ServerFeatures::haveChangePartyLeader() const
-{
- return false;
-}
-
bool ServerFeatures::haveServerHp() const
{
return tmwServerVersion > 0x0f0513;
diff --git a/src/net/tmwa/serverfeatures.h b/src/net/tmwa/serverfeatures.h
index 2c8165865..bdbaefd9d 100644
--- a/src/net/tmwa/serverfeatures.h
+++ b/src/net/tmwa/serverfeatures.h
@@ -38,8 +38,6 @@ class ServerFeatures final : public Net::ServerFeatures
bool havePartyNickInvite() const override final A_CONST;
- bool haveChangePartyLeader() const override final A_CONST;
-
bool haveServerHp() const override final;
bool havePlayerStatusUpdate() const override final A_CONST;