summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-02-27 00:45:20 +0300
committerAndrei Karas <akaras@inbox.ru>2015-02-27 01:51:18 +0300
commite13a1fc1d45c009badc10b4ec4a72bbbcf6fe592 (patch)
tree1d6fe1bcab60fb7a7ec2f6911d069394db3b6126
parentccd272519ec38b15fa5ec24fe4c6daa6eb45e3da (diff)
downloadplus-e13a1fc1d45c009badc10b4ec4a72bbbcf6fe592.tar.gz
plus-e13a1fc1d45c009badc10b4ec4a72bbbcf6fe592.tar.bz2
plus-e13a1fc1d45c009badc10b4ec4a72bbbcf6fe592.tar.xz
plus-e13a1fc1d45c009badc10b4ec4a72bbbcf6fe592.zip
Build cashshophandler only if eathena enabled.
-rw-r--r--src/CMakeLists.txt5
-rw-r--r--src/Makefile.am8
-rw-r--r--src/gui/windows/buydialog.cpp2
-rw-r--r--src/net/cashshophandler.h3
-rw-r--r--src/net/net.cpp14
-rw-r--r--src/net/tmwa/cashshophandler.h3
-rw-r--r--src/net/tmwa/generalhandler.cpp6
-rw-r--r--src/net/tmwa/generalhandler.h6
8 files changed, 28 insertions, 19 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index ef6ecdb6a..158c9e116 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1320,8 +1320,6 @@ SET(SRCS_TMWA
gui/windows/shopselldialog.h
net/tmwa/adminhandler.cpp
net/tmwa/adminhandler.h
- net/tmwa/cashshophandler.cpp
- net/tmwa/cashshophandler.h
net/tmwa/beinghandler.cpp
net/tmwa/beinghandler.h
net/tmwa/buysellhandler.cpp
@@ -1396,6 +1394,8 @@ SET(SRCS_TMWAEATHENA
net/tmwa/bankhandler.h
net/tmwa/buyingstorehandler.cpp
net/tmwa/buyingstorehandler.h
+ net/tmwa/cashshophandler.cpp
+ net/tmwa/cashshophandler.h
)
SET(SRCS_EATHENA
@@ -1422,6 +1422,7 @@ SET(SRCS_EATHENA
net/auctionhandler.h
net/bankhandler.h
net/buyingstorehandler.h
+ net/cashshophandler.h
net/eathena/adminhandler.cpp
net/eathena/adminhandler.h
net/eathena/auctionhandler.cpp
diff --git a/src/Makefile.am b/src/Makefile.am
index 289aa0116..47f49f8c0 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -645,7 +645,6 @@ manaplus_SOURCES += gui/widgets/avatarlistbox.cpp \
gui/windows/worldselectdialog.cpp \
gui/windows/worldselectdialog.h \
net/adminhandler.h \
- net/cashshophandler.h \
net/beinghandler.h \
net/buysellhandler.h \
net/character.h \
@@ -1254,8 +1253,6 @@ manaplus_SOURCES += \
gui/windows/shopselldialog.h \
net/tmwa/adminhandler.cpp \
net/tmwa/adminhandler.h \
- net/tmwa/cashshophandler.cpp \
- net/tmwa/cashshophandler.h \
net/tmwa/beinghandler.cpp \
net/tmwa/beinghandler.h \
net/tmwa/buysellhandler.cpp \
@@ -1330,7 +1327,9 @@ manaplus_SOURCES += net/tmwa/auctionhandler.cpp \
net/tmwa/bankhandler.cpp \
net/tmwa/bankhandler.h \
net/tmwa/buyingstorehandler.cpp \
- net/tmwa/buyingstorehandler.h
+ net/tmwa/buyingstorehandler.h \
+ net/tmwa/cashshophandler.cpp \
+ net/tmwa/cashshophandler.h
endif
manaplus_CXXFLAGS += -DEATHENA_SUPPORT
@@ -1357,6 +1356,7 @@ manaplus_SOURCES += gui/windows/bankwindow.cpp \
net/auctionhandler.h \
net/bankhandler.h \
net/buyingstorehandler.h \
+ net/cashshophandler.h \
net/eathena/adminhandler.cpp \
net/eathena/adminhandler.h \
net/eathena/auctionhandler.cpp \
diff --git a/src/gui/windows/buydialog.cpp b/src/gui/windows/buydialog.cpp
index a71759840..b19b88c18 100644
--- a/src/gui/windows/buydialog.cpp
+++ b/src/gui/windows/buydialog.cpp
@@ -456,6 +456,7 @@ void BuyDialog::action(const ActionEvent &event)
item->increaseQuantity(-mAmountItems);
item->update();
}
+#ifdef EATHENA_SUPPORT
else if (mNpcId == Cash)
{
cashShopHandler->buyItem(item->getPrice(),
@@ -463,6 +464,7 @@ void BuyDialog::action(const ActionEvent &event)
item->getColor(),
mAmountItems);
}
+#endif
else
{
npcHandler->buyItem(mNpcId,
diff --git a/src/net/cashshophandler.h b/src/net/cashshophandler.h
index 5e6421a0f..cbe0cb0d7 100644
--- a/src/net/cashshophandler.h
+++ b/src/net/cashshophandler.h
@@ -21,6 +21,8 @@
#ifndef NET_CASHSHOPHANDLER_H
#define NET_CASHSHOPHANDLER_H
+#ifdef EATHENA_SUPPORT
+
#include <string>
#include "localconsts.h"
@@ -44,4 +46,5 @@ class CashShopHandler notfinal
extern Net::CashShopHandler *cashShopHandler;
+#endif // EATHENA_SUPPORT
#endif // NET_CASHSHOPHANDLER_H
diff --git a/src/net/net.cpp b/src/net/net.cpp
index 527f3a34d..473ac617b 100644
--- a/src/net/net.cpp
+++ b/src/net/net.cpp
@@ -40,15 +40,15 @@
namespace Net
{
- class AdminHandler;
#ifdef EATHENA_SUPPORT
class AuctionHandler;
-#endif
class BankHandler;
- class BeingHandler;
class BuyingStoreHandler;
- class BuySellHandler;
class CashShopHandler;
+#endif
+ class AdminHandler;
+ class BeingHandler;
+ class BuySellHandler;
class CharServerHandler;
class ChatHandler;
class ElementalHandler;
@@ -95,12 +95,12 @@ Net::MailHandler *mailHandler = nullptr;
Net::MercenaryHandler *mercenaryHandler = nullptr;
#ifdef EATHENA_SUPPORT
Net::AuctionHandler *auctionHandler = nullptr;
-#endif
+Net::BankHandler *bankHandler = nullptr;
+Net::BuyingStoreHandler *buyingStoreHandler = nullptr;
Net::CashShopHandler *cashShopHandler = nullptr;
+#endif
Net::FamilyHandler *familyHandler = nullptr;
-Net::BankHandler *bankHandler = nullptr;
Net::QuestHandler *questHandler = nullptr;
-Net::BuyingStoreHandler *buyingStoreHandler = nullptr;
Net::HomunculusHandler *homunculusHandler = nullptr;
Net::FriendsHandler *friendsHandler = nullptr;
Net::ElementalHandler *elementalHandler = nullptr;
diff --git a/src/net/tmwa/cashshophandler.h b/src/net/tmwa/cashshophandler.h
index ef003cf32..e1a38e1c3 100644
--- a/src/net/tmwa/cashshophandler.h
+++ b/src/net/tmwa/cashshophandler.h
@@ -21,6 +21,8 @@
#ifndef NET_TMWA_CASHSHOPHANDLER_H
#define NET_TMWA_CASHSHOPHANDLER_H
+#ifdef EATHENA_SUPPORT
+
#include "net/cashshophandler.h"
#include "net/tmwa/messagehandler.h"
@@ -46,4 +48,5 @@ class CashShopHandler final : public MessageHandler,
} // namespace TmwAthena
+#endif // EATHENA_SUPPORT
#endif // NET_TMWA_CASHSHOPHANDLER_H
diff --git a/src/net/tmwa/generalhandler.cpp b/src/net/tmwa/generalhandler.cpp
index 9a0ccd921..1739aef45 100644
--- a/src/net/tmwa/generalhandler.cpp
+++ b/src/net/tmwa/generalhandler.cpp
@@ -108,12 +108,12 @@ GeneralHandler::GeneralHandler() :
mMailHandler(new MailHandler),
#ifdef EATHENA_SUPPORT
mAuctionHandler(new AuctionHandler),
-#endif
+ mBankHandler(new BankHandler),
+ mBuyingStoreHandler(new BuyingStoreHandler),
mCashShopHandler(new CashShopHandler),
+#endif
mFamilyHandler(new FamilyHandler),
- mBankHandler(new BankHandler),
mMercenaryHandler(new MercenaryHandler),
- mBuyingStoreHandler(new BuyingStoreHandler),
mHomunculusHandler(new HomunculusHandler),
mFriendsHandler(new FriendsHandler),
mElementalHandler(new ElementalHandler),
diff --git a/src/net/tmwa/generalhandler.h b/src/net/tmwa/generalhandler.h
index 1acc42a9e..292ce6dd7 100644
--- a/src/net/tmwa/generalhandler.h
+++ b/src/net/tmwa/generalhandler.h
@@ -84,12 +84,12 @@ class GeneralHandler final : public MessageHandler,
MessageHandlerPtr mMailHandler;
#ifdef EATHENA_SUPPORT
MessageHandlerPtr mAuctionHandler;
-#endif
+ MessageHandlerPtr mBankHandler;
+ MessageHandlerPtr mBuyingStoreHandler;
MessageHandlerPtr mCashShopHandler;
+#endif
MessageHandlerPtr mFamilyHandler;
- MessageHandlerPtr mBankHandler;
MessageHandlerPtr mMercenaryHandler;
- MessageHandlerPtr mBuyingStoreHandler;
MessageHandlerPtr mHomunculusHandler;
MessageHandlerPtr mFriendsHandler;
MessageHandlerPtr mElementalHandler;