summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-05-08 18:43:49 +0300
committerAndrei Karas <akaras@inbox.ru>2017-05-08 18:43:49 +0300
commit0c1c6b5df196443b18e9e0ef2e9ef3de350a7234 (patch)
treee3f8ff1f0a844fca28c6ddc4af919880cbc2d5ac /src
parent4f96bf265375b7ca580f072f5a25c8b4097fb04a (diff)
downloadmanaplus-0c1c6b5df196443b18e9e0ef2e9ef3de350a7234.tar.gz
manaplus-0c1c6b5df196443b18e9e0ef2e9ef3de350a7234.tar.bz2
manaplus-0c1c6b5df196443b18e9e0ef2e9ef3de350a7234.tar.xz
manaplus-0c1c6b5df196443b18e9e0ef2e9ef3de350a7234.zip
Fix wrong checks after removing some server features.
Diffstat (limited to 'src')
-rw-r--r--src/actions/actions.cpp9
-rw-r--r--src/actormanager.cpp2
-rw-r--r--src/being/localplayer.cpp4
-rw-r--r--src/game.cpp2
-rw-r--r--src/gui/popups/popupmenu.cpp12
-rw-r--r--src/gui/widgets/attrs/changedisplay.cpp2
-rw-r--r--src/gui/widgets/shoplistbox.cpp2
-rw-r--r--src/gui/widgets/tabs/chat/partytab.cpp4
-rw-r--r--src/gui/windows/buydialog.cpp2
-rw-r--r--src/gui/windows/charselectdialog.cpp2
-rw-r--r--src/gui/windows/chatwindow.cpp4
-rw-r--r--src/gui/windows/npcselldialog.cpp2
-rw-r--r--src/gui/windows/shopwindow.cpp2
-rw-r--r--src/gui/windows/tradewindow.cpp2
-rw-r--r--src/resources/item/item.cpp2
15 files changed, 29 insertions, 24 deletions
diff --git a/src/actions/actions.cpp b/src/actions/actions.cpp
index 698d1f4f8..eaf0da026 100644
--- a/src/actions/actions.cpp
+++ b/src/actions/actions.cpp
@@ -733,7 +733,7 @@ impHandler(buy)
}
else if (being->getType() == ActorType::Player)
{
- if (vendingHandler && Net::getNetworkType() == ServerType::EATHENA)
+ if (vendingHandler && Net::getNetworkType() != ServerType::TMWATHENA)
vendingHandler->open(being);
else if (buySellHandler)
buySellHandler->requestSellList(being->getName());
@@ -779,10 +779,15 @@ impHandler(sell)
}
else if (being->getType() == ActorType::Player)
{
- if (buyingStoreHandler && Net::getNetworkType() == ServerType::EATHENA)
+ if (buyingStoreHandler &&
+ Net::getNetworkType() != ServerType::TMWATHENA)
+ {
buyingStoreHandler->open(being);
+ }
else if (buySellHandler)
+ {
buySellHandler->requestBuyList(being->getName());
+ }
return true;
}
return false;
diff --git a/src/actormanager.cpp b/src/actormanager.cpp
index 114e2acd5..5ab03c6bb 100644
--- a/src/actormanager.cpp
+++ b/src/actormanager.cpp
@@ -298,7 +298,7 @@ Being *ActorManager::createBeing(const BeingId id,
break;
case ActorType::Monster:
#ifdef TMWA_SUPPORT
- if (Net::getNetworkType() == ServerType::EATHENA)
+ if (Net::getNetworkType() != ServerType::TMWATHENA)
#endif // TMWA_SUPPORT
{
beingHandler->requestNameById(id);
diff --git a/src/being/localplayer.cpp b/src/being/localplayer.cpp
index 614f43880..ee3213245 100644
--- a/src/being/localplayer.cpp
+++ b/src/being/localplayer.cpp
@@ -1229,7 +1229,7 @@ void LocalPlayer::statChanged(const AttributesT id,
{
if (!mShowJobExp ||
id != Attributes::PLAYER_JOB ||
- Net::getNetworkType() == ServerType::EATHENA)
+ Net::getNetworkType() != ServerType::TMWATHENA)
{
return;
}
@@ -1252,7 +1252,7 @@ void LocalPlayer::attributeChanged(const AttributesT id,
{
case Attributes::PLAYER_EXP:
{
- if (Net::getNetworkType() == ServerType::EATHENA)
+ if (Net::getNetworkType() != ServerType::TMWATHENA)
break;
if (oldVal > newVal)
break;
diff --git a/src/game.cpp b/src/game.cpp
index ed04a905d..cf58a1930 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -210,7 +210,7 @@ static void createGuiWindows()
CREATEWIDGETV0(miniStatusWindow, MiniStatusWindow);
CREATEWIDGETV(inventoryWindow, InventoryWindow,
PlayerInfo::getInventory());
- if (Net::getNetworkType() == ServerType::EATHENA)
+ if (Net::getNetworkType() != ServerType::TMWATHENA)
{
CREATEWIDGETV(cartWindow, InventoryWindow,
PlayerInfo::getCartInventory());
diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp
index fc75f31ab..755dbf8da 100644
--- a/src/gui/popups/popupmenu.cpp
+++ b/src/gui/popups/popupmenu.cpp
@@ -265,7 +265,7 @@ void PopupMenu::showPopup(const int x, const int y, const Being *const being)
// TRANSLATORS: talk with npc
mBrowserBox->addRow("/talk 'NAME'", _("Talk"));
#ifdef TMWA_SUPPORT
- if (Net::getNetworkType() == ServerType::EATHENA)
+ if (Net::getNetworkType() != ServerType::TMWATHENA)
#endif
{
mBrowserBox->addRow("/whispertext NPC:'NAME'",
@@ -1014,7 +1014,7 @@ void PopupMenu::showChatPopup(const int x, const int y, ChatTab *const tab)
}
addPlayerMisc();
addBuySellDefault();
- if (Net::getNetworkType() == ServerType::EATHENA)
+ if (Net::getNetworkType() != ServerType::TMWATHENA)
addParty(wTab->getNick());
mBrowserBox->addRow("##3---");
}
@@ -1138,7 +1138,7 @@ void PopupMenu::showEmoteType()
// TRANSLATORS: show emotes for pet
mBrowserBox->addRow("/setemotetype pet", _("Pet"));
- if (Net::getNetworkType() == ServerType::EATHENA)
+ if (Net::getNetworkType() == ServerType::EVOL2)
{
// TRANSLATORS: popup menu item
// TRANSLATORS: show emotes for homuncules
@@ -2705,7 +2705,7 @@ void PopupMenu::addBuySell(const Being *const being)
{
mBrowserBox->addRow("##3---");
const bool haveVending =
- (Net::getNetworkType() == ServerType::EATHENA);
+ (Net::getNetworkType() != ServerType::TMWATHENA);
if (being->isSellShopEnabled())
{
// TRANSLATORS: popup menu item
@@ -3140,7 +3140,7 @@ void PopupMenu::showMuteCommands()
mBrowserBox->addRow(strprintf(_("Mute %s"),
mName.c_str()));
if (mBeingId != BeingId_zero &&
- Net::getNetworkType() == ServerType::EATHENA)
+ Net::getNetworkType() != ServerType::TMWATHENA)
{
mBrowserBox->addRow("mute_+1",
// TRANSLATORS: popup menu item
@@ -3432,7 +3432,7 @@ void PopupMenu::addSocialMenu()
mBrowserBox->addRow("/createparty", _("Create party"));
}
- if (Net::getNetworkType() == ServerType::EATHENA)
+ if (Net::getNetworkType() != ServerType::TMWATHENA)
{
const Guild *const guild = localPlayer->getGuild();
if (guild)
diff --git a/src/gui/widgets/attrs/changedisplay.cpp b/src/gui/widgets/attrs/changedisplay.cpp
index fead88dcd..e1af1eb76 100644
--- a/src/gui/widgets/attrs/changedisplay.cpp
+++ b/src/gui/widgets/attrs/changedisplay.cpp
@@ -102,7 +102,7 @@ void ChangeDisplay::action(const ActionEvent &event)
const int newbase = PlayerInfo::getStatBase(mId) + cnt;
PlayerInfo::setStatBase(mId, newbase);
- if (Net::getNetworkType() == ServerType::EATHENA)
+ if (Net::getNetworkType() != ServerType::TMWATHENA)
{
playerHandler->increaseAttribute(mId, cnt);
}
diff --git a/src/gui/widgets/shoplistbox.cpp b/src/gui/widgets/shoplistbox.cpp
index a105c1f5a..f1e5ed32f 100644
--- a/src/gui/widgets/shoplistbox.cpp
+++ b/src/gui/widgets/shoplistbox.cpp
@@ -253,7 +253,7 @@ void ShopListBox::mouseReleased(MouseEvent& event)
return;
}
if (mType == ShopListBoxType::SellShop &&
- Net::getNetworkType() == ServerType::EATHENA &&
+ Net::getNetworkType() != ServerType::TMWATHENA &&
src != DragDropSource::Cart)
{
return;
diff --git a/src/gui/widgets/tabs/chat/partytab.cpp b/src/gui/widgets/tabs/chat/partytab.cpp
index c8fee32ad..366a78241 100644
--- a/src/gui/widgets/tabs/chat/partytab.cpp
+++ b/src/gui/widgets/tabs/chat/partytab.cpp
@@ -101,7 +101,7 @@ bool PartyTab::handleCommand(const std::string &restrict type,
this);
}
else if (type == "setleader" &&
- Net::getNetworkType() == ServerType::EATHENA)
+ Net::getNetworkType() != ServerType::TMWATHENA)
{
inputManager.executeChatCommand(
InputAction::COMMAND_CHANGE_PARTY_LEADER,
@@ -135,7 +135,7 @@ void PartyTab::getAutoCompleteCommands(StringVect &names) const
names.push_back("/kick ");
names.push_back("/item");
names.push_back("/exp");
- if (Net::getNetworkType() == ServerType::EATHENA)
+ if (Net::getNetworkType() != ServerType::TMWATHENA)
names.push_back("/setleader ");
}
diff --git a/src/gui/windows/buydialog.cpp b/src/gui/windows/buydialog.cpp
index c93ac6aa2..a07f9d849 100644
--- a/src/gui/windows/buydialog.cpp
+++ b/src/gui/windows/buydialog.cpp
@@ -221,7 +221,7 @@ BuyDialog::BuyDialog(const BeingId npcId,
mMoney(0),
mAmountItems(0),
mMaxItems(0),
- mAdvanced(Net::getNetworkType() == ServerType::EATHENA)
+ mAdvanced(Net::getNetworkType() != ServerType::TMWATHENA)
{
init();
}
diff --git a/src/gui/windows/charselectdialog.cpp b/src/gui/windows/charselectdialog.cpp
index a2c40de7f..d697ebf2b 100644
--- a/src/gui/windows/charselectdialog.cpp
+++ b/src/gui/windows/charselectdialog.cpp
@@ -101,7 +101,7 @@ CharSelectDialog::CharSelectDialog(LoginData &data) :
placer(n, 0, mDeleteButton);
n ++;
#ifdef TMWA_SUPPORT
- if (Net::getNetworkType() == ServerType::EATHENA)
+ if (Net::getNetworkType() != ServerType::TMWATHENA)
#endif
{
mRenameButton = new Button(this,
diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp
index 1e10c08bb..45353fdc7 100644
--- a/src/gui/windows/chatwindow.cpp
+++ b/src/gui/windows/chatwindow.cpp
@@ -1299,7 +1299,7 @@ ChatTab *ChatWindow::addChatTab(const std::string &name,
const bool switchTo,
const bool join)
{
- if (Net::getNetworkType() == ServerType::EATHENA &&
+ if (Net::getNetworkType() != ServerType::TMWATHENA &&
name.size() > 1 &&
name[0] == '#')
{
@@ -1697,7 +1697,7 @@ bool ChatWindow::resortChatLog(std::string line,
tryRemoveColors);
}
}
- else if (Net::getNetworkType() == ServerType::EATHENA)
+ else if (Net::getNetworkType() != ServerType::TMWATHENA)
{
channelChatLog(channel, line, own, ignoreRecord, tryRemoveColors);
return false;
diff --git a/src/gui/windows/npcselldialog.cpp b/src/gui/windows/npcselldialog.cpp
index 7e964a7d1..7238cd8c6 100644
--- a/src/gui/windows/npcselldialog.cpp
+++ b/src/gui/windows/npcselldialog.cpp
@@ -46,7 +46,7 @@
NpcSellDialog::NpcSellDialog(const BeingId npcId) :
SellDialog(IsSell_true,
- (Net::getNetworkType() == ServerType::EATHENA) ?
+ (Net::getNetworkType() != ServerType::TMWATHENA) ?
Advanced_true : Advanced_false),
mNpcId(npcId)
{
diff --git a/src/gui/windows/shopwindow.cpp b/src/gui/windows/shopwindow.cpp
index f3d187aa6..4ba33a214 100644
--- a/src/gui/windows/shopwindow.cpp
+++ b/src/gui/windows/shopwindow.cpp
@@ -140,7 +140,7 @@ ShopWindow::ShopWindow() :
mSellShopSize(0),
mBuyShopSize(0),
isBuySelected(true),
- mHaveVending(Net::getNetworkType() == ServerType::EATHENA),
+ mHaveVending(Net::getNetworkType() != ServerType::TMWATHENA),
mEnableBuyingStore(false),
mEnableVending(false)
{
diff --git a/src/gui/windows/tradewindow.cpp b/src/gui/windows/tradewindow.cpp
index cdd5837d9..982f2dafd 100644
--- a/src/gui/windows/tradewindow.cpp
+++ b/src/gui/windows/tradewindow.cpp
@@ -535,7 +535,7 @@ bool TradeWindow::checkItem(const Item *const item) const
}
return false;
}
- if (Net::getNetworkType() == ServerType::EATHENA &&
+ if (Net::getNetworkType() != ServerType::TMWATHENA &&
item->isEquipped() == Equipped_true)
{
if (localChatTab)
diff --git a/src/resources/item/item.cpp b/src/resources/item/item.cpp
index 86bd84aa4..45e365553 100644
--- a/src/resources/item/item.cpp
+++ b/src/resources/item/item.cpp
@@ -195,6 +195,6 @@ void Item::setOptions(const ItemOptionsList *const options)
void Item::updateColor()
{
- if (Net::getNetworkType() == ServerType::EATHENA)
+ if (Net::getNetworkType() != ServerType::TMWATHENA)
setId(mId, ItemColorManager::getColorFromCards(&mCards[0]));
}