summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-05-01 21:09:57 +0300
committerAndrei Karas <akaras@inbox.ru>2017-05-01 21:09:57 +0300
commitf16af47bd98f865193fcea1bbd9507904e2b20af (patch)
tree3a01a3a794b24114426bb5dd80b5d03136548770
parentd9be3eb4cf0ebbe29ef93759a3d168ebe9e592c1 (diff)
downloadmv-f16af47bd98f865193fcea1bbd9507904e2b20af.tar.gz
mv-f16af47bd98f865193fcea1bbd9507904e2b20af.tar.bz2
mv-f16af47bd98f865193fcea1bbd9507904e2b20af.tar.xz
mv-f16af47bd98f865193fcea1bbd9507904e2b20af.zip
Remove ServerFeatures haveCart because it depend only on server type.
-rw-r--r--src/actions/windows.cpp3
-rw-r--r--src/game.cpp3
-rw-r--r--src/gui/widgets/shoplistbox.cpp3
-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
8 files changed, 5 insertions, 20 deletions
diff --git a/src/actions/windows.cpp b/src/actions/windows.cpp
index c135ab541..2271e12f8 100644
--- a/src/actions/windows.cpp
+++ b/src/actions/windows.cpp
@@ -278,8 +278,7 @@ impHandler0(bankWindowShow)
impHandler0(cartWindowShow)
{
- if (!serverFeatures ||
- !serverFeatures->haveCart() ||
+ if (Net::getNetworkType() == ServerType::TMWATHENA ||
!localPlayer ||
!localPlayer->getHaveCart())
{
diff --git a/src/game.cpp b/src/game.cpp
index c8d51aff4..c9ef20ea2 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -104,6 +104,7 @@
#include "net/generalhandler.h"
#include "net/gamehandler.h"
+#include "net/net.h"
#include "net/packetcounters.h"
#include "net/serverfeatures.h"
@@ -210,7 +211,7 @@ static void createGuiWindows()
CREATEWIDGETV0(miniStatusWindow, MiniStatusWindow);
CREATEWIDGETV(inventoryWindow, InventoryWindow,
PlayerInfo::getInventory());
- if (serverFeatures && serverFeatures->haveCart())
+ if (Net::getNetworkType() == ServerType::EATHENA)
{
CREATEWIDGETV(cartWindow, InventoryWindow,
PlayerInfo::getCartInventory());
diff --git a/src/gui/widgets/shoplistbox.cpp b/src/gui/widgets/shoplistbox.cpp
index 0fcce799a..004263119 100644
--- a/src/gui/widgets/shoplistbox.cpp
+++ b/src/gui/widgets/shoplistbox.cpp
@@ -38,6 +38,7 @@
#include "gui/windows/itemamountwindow.h"
+#include "net/net.h"
#include "net/serverfeatures.h"
#include "resources/inventory/inventory.h"
@@ -253,7 +254,7 @@ void ShopListBox::mouseReleased(MouseEvent& event)
return;
}
if (mType == ShopListBoxType::SellShop &&
- serverFeatures->haveCart() &&
+ Net::getNetworkType() == ServerType::EATHENA &&
src != DragDropSource::Cart)
{
return;
diff --git a/src/net/eathena/serverfeatures.cpp b/src/net/eathena/serverfeatures.cpp
index 013dccde4..a704e41c8 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::haveCart() const
-{
- return true;
-}
-
bool ServerFeatures::haveCards() const
{
return true;
diff --git a/src/net/eathena/serverfeatures.h b/src/net/eathena/serverfeatures.h
index c55ab46a0..2c8162bc6 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 haveCart() const override final A_CONST;
-
bool haveCards() const override final A_CONST;
bool haveTalkPet() const override final;
diff --git a/src/net/serverfeatures.h b/src/net/serverfeatures.h
index 3aee1b19d..521c764b9 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 haveCart() const = 0;
-
virtual bool haveCards() const = 0;
virtual bool haveTalkPet() const = 0;
diff --git a/src/net/tmwa/serverfeatures.cpp b/src/net/tmwa/serverfeatures.cpp
index ddb843c1f..47f4ea4a6 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::haveCart() const
-{
- return false;
-}
-
bool ServerFeatures::haveCards() const
{
return false;
diff --git a/src/net/tmwa/serverfeatures.h b/src/net/tmwa/serverfeatures.h
index 9ed734724..76cb2085b 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 haveCart() const override final A_CONST;
-
bool haveCards() const override final A_CONST;
bool haveTalkPet() const override final A_CONST;