diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-02-28 21:12:15 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-02-28 21:12:15 +0300 |
commit | b96242e1d5a6af71e6f884596f77268743945c63 (patch) | |
tree | 1fc425037771265a1134956641c466095b7349a1 | |
parent | 0cc662938674c22bb5a3d1e1521fe90eb28121e4 (diff) | |
download | manaplus-b96242e1d5a6af71e6f884596f77268743945c63.tar.gz manaplus-b96242e1d5a6af71e6f884596f77268743945c63.tar.bz2 manaplus-b96242e1d5a6af71e6f884596f77268743945c63.tar.xz manaplus-b96242e1d5a6af71e6f884596f77268743945c63.zip |
Build homunculushandler only if eathena enabled.
-rw-r--r-- | src/CMakeLists.txt | 6 | ||||
-rw-r--r-- | src/Makefile.am | 8 | ||||
-rw-r--r-- | src/actions/commands.cpp | 18 | ||||
-rw-r--r-- | src/being/playerinfo.cpp | 4 | ||||
-rw-r--r-- | src/gui/popups/popupmenu.cpp | 2 | ||||
-rw-r--r-- | src/net/eathena/homunculushandler.h | 3 | ||||
-rw-r--r-- | src/net/homunculushandler.h | 3 | ||||
-rw-r--r-- | src/net/net.cpp | 4 | ||||
-rw-r--r-- | src/net/tmwa/generalhandler.cpp | 4 | ||||
-rw-r--r-- | src/net/tmwa/generalhandler.h | 2 | ||||
-rw-r--r-- | src/net/tmwa/homunculushandler.h | 3 |
11 files changed, 45 insertions, 12 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9c3e08aef..25deb17d6 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -533,7 +533,6 @@ SET(SRCS net/gamehandler.h net/generalhandler.h net/guildhandler.h - net/homunculushandler.h net/inventoryhandler.h net/ipc.cpp net/ipc.h @@ -1333,8 +1332,6 @@ SET(SRCS_TMWA net/tmwa/generalhandler.h net/tmwa/guildhandler.cpp net/tmwa/guildhandler.h - net/tmwa/homunculushandler.cpp - net/tmwa/homunculushandler.h net/tmwa/inventoryhandler.cpp net/tmwa/inventoryhandler.h net/tmwa/itemhandler.cpp @@ -1395,6 +1392,8 @@ SET(SRCS_TMWAEATHENA net/tmwa/familyhandler.h net/tmwa/friendshandler.cpp net/tmwa/friendshandler.h + net/tmwa/homunculushandler.cpp + net/tmwa/homunculushandler.h ) SET(SRCS_EATHENA @@ -1425,6 +1424,7 @@ SET(SRCS_EATHENA net/elementalhandler.h net/familyhandler.h net/friendshandler.h + net/homunculushandler.h net/eathena/adminhandler.cpp net/eathena/adminhandler.h net/eathena/auctionhandler.cpp diff --git a/src/Makefile.am b/src/Makefile.am index 9ffcfc8f8..efc993a16 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -659,7 +659,6 @@ manaplus_SOURCES += gui/widgets/avatarlistbox.cpp \ net/gamehandler.h \ net/generalhandler.h \ net/guildhandler.h \ - net/homunculushandler.h \ net/inventoryhandler.h \ net/ipc.cpp \ net/ipc.h \ @@ -1264,8 +1263,6 @@ manaplus_SOURCES += \ net/tmwa/generalhandler.h \ net/tmwa/guildhandler.cpp \ net/tmwa/guildhandler.h \ - net/tmwa/homunculushandler.cpp \ - net/tmwa/homunculushandler.h \ net/tmwa/inventoryhandler.cpp \ net/tmwa/inventoryhandler.h \ net/tmwa/itemhandler.cpp \ @@ -1326,7 +1323,9 @@ manaplus_SOURCES += net/tmwa/auctionhandler.cpp \ net/tmwa/familyhandler.cpp \ net/tmwa/familyhandler.h \ net/tmwa/friendshandler.cpp \ - net/tmwa/friendshandler.h + net/tmwa/friendshandler.h \ + net/tmwa/homunculushandler.cpp \ + net/tmwa/homunculushandler.h endif manaplus_CXXFLAGS += -DEATHENA_SUPPORT @@ -1357,6 +1356,7 @@ manaplus_SOURCES += gui/windows/bankwindow.cpp \ net/elementalhandler.h \ net/familyhandler.h \ net/friendshandler.h \ + net/homunculushandler.h \ net/eathena/adminhandler.cpp \ net/eathena/adminhandler.h \ net/eathena/auctionhandler.cpp \ diff --git a/src/actions/commands.cpp b/src/actions/commands.cpp index 25be294a0..f51620e11 100644 --- a/src/actions/commands.cpp +++ b/src/actions/commands.cpp @@ -773,18 +773,26 @@ impHandler(serverUnIgnoreWhisper) impHandler(setHomunculusName) { +#ifdef EATHENA_SUPPORT const std::string args = event.args; if (args.empty()) return false; homunculusHandler->setName(args); return true; +#else + return false; +#endif } impHandler0(fireHomunculus) { +#ifdef EATHENA_SUPPORT homunculusHandler->fire(); return true; +#else + return false; +#endif } impHandler0(leaveParty) @@ -808,6 +816,7 @@ impHandler(warp) impHandler(homunTalk) { +#ifdef EATHENA_SUPPORT if (!serverFeatures->haveTalkPet()) return false; @@ -816,10 +825,14 @@ impHandler(homunTalk) args = textToMe(args); homunculusHandler->talk(args); return true; +#else + return false; +#endif } impHandler(homunEmote) { +#ifdef EATHENA_SUPPORT if (!serverFeatures->haveTalkPet()) return false; @@ -833,18 +846,23 @@ impHandler(homunEmote) Game::instance()->setValidSpeed(); return true; } +#endif return false; } impHandler(commandHomunEmote) { +#ifdef EATHENA_SUPPORT if (!serverFeatures->haveTalkPet()) return false; homunculusHandler->emote(static_cast<uint8_t>( atoi(event.args.c_str()))); return true; +#else + return false; +#endif } } // namespace Actions diff --git a/src/being/playerinfo.cpp b/src/being/playerinfo.cpp index 6b3bb2703..a3eb640a9 100644 --- a/src/being/playerinfo.cpp +++ b/src/being/playerinfo.cpp @@ -563,16 +563,20 @@ void updateMoveAI() { if (mMercenary) mercenaryHandler->moveToMaster(); +#ifdef EATHENA_SUPPORT if (mHomunculus) homunculusHandler->moveToMaster(); +#endif } void updateAttackAi(const int targetId, const bool keep) { if (mMercenary) mercenaryHandler->attack(targetId, keep); +#ifdef EATHENA_SUPPORT if (mHomunculus) homunculusHandler->attack(targetId, keep); +#endif } void setGuildPositionFlags(const GuildPositionFlags::Type pos) diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp index 7a4e9ae67..936e490a3 100644 --- a/src/gui/popups/popupmenu.cpp +++ b/src/gui/popups/popupmenu.cpp @@ -1472,6 +1472,7 @@ void PopupMenu::handleLink(const std::string &link, { mercenaryHandler->moveToMaster(); } +#ifdef EATHENA_SUPPORT else if (link == "homunculus to master") { homunculusHandler->moveToMaster(); @@ -1484,6 +1485,7 @@ void PopupMenu::handleLink(const std::string &link, { homunculusHandler->fire(); } +#endif else if (link == "pet feed") { petHandler->feed(); diff --git a/src/net/eathena/homunculushandler.h b/src/net/eathena/homunculushandler.h index a8d80fc65..db992b5b3 100644 --- a/src/net/eathena/homunculushandler.h +++ b/src/net/eathena/homunculushandler.h @@ -21,6 +21,8 @@ #ifndef NET_EATHENA_HOMUNCULUSHANDLER_H #define NET_EATHENA_HOMUNCULUSHANDLER_H +#ifdef EATHENA_SUPPORT + #include "net/homunculushandler.h" #include "net/eathena/messagehandler.h" @@ -69,4 +71,5 @@ class HomunculusHandler final : public MessageHandler, } // namespace EAthena +#endif // EATHENA_SUPPORT #endif // NET_EATHENA_HOMUNCULUSHANDLER_H diff --git a/src/net/homunculushandler.h b/src/net/homunculushandler.h index 31fb65f08..e587a02e8 100644 --- a/src/net/homunculushandler.h +++ b/src/net/homunculushandler.h @@ -21,6 +21,8 @@ #ifndef NET_HOMUNCULUSHANDLER_H #define NET_HOMUNCULUSHANDLER_H +#ifdef EATHENA_SUPPORT + #include <string> #include "localconsts.h" @@ -57,4 +59,5 @@ class HomunculusHandler notfinal extern Net::HomunculusHandler *homunculusHandler; +#endif // EATHENA_SUPPORT #endif // NET_HOMUNCULUSHANDLER_H diff --git a/src/net/net.cpp b/src/net/net.cpp index 47ab9d8a0..5a6156653 100644 --- a/src/net/net.cpp +++ b/src/net/net.cpp @@ -48,6 +48,7 @@ namespace Net class ElementalHandler; class FamilyHandler; class FriendsHandler; + class HomunculusHandler; #endif class AdminHandler; class BeingHandler; @@ -57,7 +58,6 @@ namespace Net class GameHandler; class GeneralHandler; class GuildHandler; - class HomunculusHandler; class InventoryHandler; class MailHandler; class MarketHandler; @@ -101,9 +101,9 @@ Net::CashShopHandler *cashShopHandler = nullptr; Net::ElementalHandler *elementalHandler = nullptr; Net::FamilyHandler *familyHandler = nullptr; Net::FriendsHandler *friendsHandler = nullptr; +Net::HomunculusHandler *homunculusHandler = nullptr; #endif Net::QuestHandler *questHandler = nullptr; -Net::HomunculusHandler *homunculusHandler = nullptr; Net::MarketHandler *marketHandler = nullptr; Net::VendingHandler *vendingHandler = nullptr; Net::SearchStoreHandler *searchStoreHandler = nullptr; diff --git a/src/net/tmwa/generalhandler.cpp b/src/net/tmwa/generalhandler.cpp index e525d5b85..2a353df80 100644 --- a/src/net/tmwa/generalhandler.cpp +++ b/src/net/tmwa/generalhandler.cpp @@ -114,9 +114,9 @@ GeneralHandler::GeneralHandler() : mElementalHandler(new ElementalHandler), mFamilyHandler(new FamilyHandler), mFriendsHandler(new FriendsHandler), + mHomunculusHandler(new HomunculusHandler), #endif mMercenaryHandler(new MercenaryHandler), - mHomunculusHandler(new HomunculusHandler), mMarketHandler(new MarketHandler), mVendingHandler(new VendingHandler), mSearchStoreHandler(new SearchStoreHandler) @@ -244,9 +244,9 @@ void GeneralHandler::load() mNetwork->registerHandler(mElementalHandler); mNetwork->registerHandler(mFamilyHandler); mNetwork->registerHandler(mFriendsHandler); + mNetwork->registerHandler(mHomunculusHandler); #endif mNetwork->registerHandler(mMercenaryHandler); - mNetwork->registerHandler(mHomunculusHandler); mNetwork->registerHandler(mMarketHandler); mNetwork->registerHandler(mVendingHandler); mNetwork->registerHandler(mSearchStoreHandler); diff --git a/src/net/tmwa/generalhandler.h b/src/net/tmwa/generalhandler.h index 2075702ef..746df8460 100644 --- a/src/net/tmwa/generalhandler.h +++ b/src/net/tmwa/generalhandler.h @@ -90,9 +90,9 @@ class GeneralHandler final : public MessageHandler, MessageHandlerPtr mElementalHandler; MessageHandlerPtr mFamilyHandler; MessageHandlerPtr mFriendsHandler; + MessageHandlerPtr mHomunculusHandler; #endif MessageHandlerPtr mMercenaryHandler; - MessageHandlerPtr mHomunculusHandler; MessageHandlerPtr mMarketHandler; MessageHandlerPtr mVendingHandler; MessageHandlerPtr mSearchStoreHandler; diff --git a/src/net/tmwa/homunculushandler.h b/src/net/tmwa/homunculushandler.h index bd39b54bb..5b4272161 100644 --- a/src/net/tmwa/homunculushandler.h +++ b/src/net/tmwa/homunculushandler.h @@ -21,6 +21,8 @@ #ifndef NET_TMWA_HOMUNCULUSHANDLER_H #define NET_TMWA_HOMUNCULUSHANDLER_H +#ifdef EATHENA_SUPPORT + #include "net/homunculushandler.h" #include "net/tmwa/messagehandler.h" @@ -59,4 +61,5 @@ class HomunculusHandler final : public MessageHandler, } // namespace TmwAthena +#endif // EATHENA_SUPPORT #endif // NET_TMWA_HOMUNCULUSHANDLER_H |