diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-09-17 11:50:28 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-09-17 11:50:28 +0300 |
commit | 616ab2676cc932ab59152c510d584c429090987a (patch) | |
tree | 9184b8836b51a073f67ee60a46043084687207a7 /src/net/tmwa | |
parent | 4b397f4c8e2b0c8d636cc2782d9571567473975b (diff) | |
download | plus-616ab2676cc932ab59152c510d584c429090987a.tar.gz plus-616ab2676cc932ab59152c510d584c429090987a.tar.bz2 plus-616ab2676cc932ab59152c510d584c429090987a.tar.xz plus-616ab2676cc932ab59152c510d584c429090987a.zip |
Remove getter for serverFeatures.
Diffstat (limited to 'src/net/tmwa')
-rw-r--r-- | src/net/tmwa/beinghandler.cpp | 20 | ||||
-rw-r--r-- | src/net/tmwa/buysellhandler.cpp | 4 | ||||
-rw-r--r-- | src/net/tmwa/charserverhandler.cpp | 4 | ||||
-rw-r--r-- | src/net/tmwa/chathandler.cpp | 6 | ||||
-rw-r--r-- | src/net/tmwa/guildhandler.cpp | 2 | ||||
-rw-r--r-- | src/net/tmwa/inventoryhandler.cpp | 12 | ||||
-rw-r--r-- | src/net/tmwa/loginhandler.cpp | 2 | ||||
-rw-r--r-- | src/net/tmwa/npchandler.cpp | 2 |
8 files changed, 26 insertions, 26 deletions
diff --git a/src/net/tmwa/beinghandler.cpp b/src/net/tmwa/beinghandler.cpp index bea17edb6..2a9b31c0f 100644 --- a/src/net/tmwa/beinghandler.cpp +++ b/src/net/tmwa/beinghandler.cpp @@ -296,7 +296,7 @@ void BeingHandler::processBeingChangeLook2(Net::MessageIn &msg) const int id2 = 0; const int16_t id = msg.readInt16("id1"); - if (type == 2 || Net::getServerFeatures()->haveItemColors()) + if (type == 2 || serverFeatures->haveItemColors()) { id2 = msg.readInt16("id2"); } @@ -569,7 +569,7 @@ void BeingHandler::processPlayerUpdate1(Net::MessageIn &msg) const dstBeing->updateSprite(SPRITE_WEAPON, weapon, "", 1, true); if (!mHideShield) dstBeing->updateSprite(SPRITE_SHIELD, shield); - if (Net::getServerFeatures()->haveItemColors()) + if (serverFeatures->haveItemColors()) { dstBeing->updateSprite(SPRITE_BOTTOMCLOTHES, headBottom, "", colors[0]); @@ -720,7 +720,7 @@ void BeingHandler::processPlayerUpdate2(Net::MessageIn &msg) const dstBeing->updateSprite(SPRITE_WEAPON, weapon, "", 1, true); if (!mHideShield) dstBeing->updateSprite(SPRITE_SHIELD, shield); - if (Net::getServerFeatures()->haveItemColors()) + if (serverFeatures->haveItemColors()) { dstBeing->updateSprite(SPRITE_BOTTOMCLOTHES, headBottom, "", colors[0]); @@ -871,7 +871,7 @@ void BeingHandler::processPlayerMove(Net::MessageIn &msg) const dstBeing->updateSprite(SPRITE_WEAPON, weapon, "", 1, true); if (!mHideShield) dstBeing->updateSprite(SPRITE_SHIELD, shield); - if (Net::getServerFeatures()->haveItemColors()) + if (serverFeatures->haveItemColors()) { dstBeing->updateSprite(SPRITE_BOTTOMCLOTHES, headBottom, "", colors[0]); @@ -947,7 +947,7 @@ void BeingHandler::processPlayerMove(Net::MessageIn &msg) const void BeingHandler::processBeingMove3(Net::MessageIn &msg) { BLOCK_START("BeingHandler::processBeingMove3") - if (!Net::getServerFeatures()->haveMove3()) + if (!serverFeatures->haveMove3()) { BLOCK_END("BeingHandler::processBeingMove3") return; @@ -1103,7 +1103,7 @@ void BeingHandler::processBeingVisible(Net::MessageIn &msg) uint16_t gloves; if (dstBeing->getType() == ActorType::Monster) { - if (Net::getServerFeatures()->haveServerHp()) + if (serverFeatures->haveServerHp()) { const int hp = msg.readInt32("hp"); const int maxHP = msg.readInt32("max hp"); @@ -1131,7 +1131,7 @@ void BeingHandler::processBeingVisible(Net::MessageIn &msg) msg.readInt16("manner"); dstBeing->setStatusEffectBlock(32, msg.readInt16("opt3")); - if (Net::getServerFeatures()->haveMonsterAttackRange() + if (serverFeatures->haveMonsterAttackRange() && dstBeing->getType() == ActorType::Monster) { const int attackRange = static_cast<int>( @@ -1307,7 +1307,7 @@ void BeingHandler::processBeingMove(Net::MessageIn &msg) uint16_t gloves; if (dstBeing->getType() == ActorType::Monster) { - if (Net::getServerFeatures()->haveServerHp()) + if (serverFeatures->haveServerHp()) { const int hp = msg.readInt32("hp"); const int maxHP = msg.readInt32("max hp"); @@ -1335,7 +1335,7 @@ void BeingHandler::processBeingMove(Net::MessageIn &msg) msg.readInt16("manner"); dstBeing->setStatusEffectBlock(32, msg.readInt16("opt3")); - if (Net::getServerFeatures()->haveMonsterAttackRange() + if (serverFeatures->haveMonsterAttackRange() && dstBeing->getType() == ActorType::Monster) { const int attackRange = static_cast<int>( @@ -1377,7 +1377,7 @@ void BeingHandler::processBeingMove(Net::MessageIn &msg) { dstBeing->setAction(BeingAction::STAND, 0); dstBeing->setTileCoords(srcX, srcY); - if (!Net::getServerFeatures()->haveMove3()) + if (!serverFeatures->haveMove3()) dstBeing->setDestination(dstX, dstY); } diff --git a/src/net/tmwa/buysellhandler.cpp b/src/net/tmwa/buysellhandler.cpp index 2b34e0a83..5de7b0556 100644 --- a/src/net/tmwa/buysellhandler.cpp +++ b/src/net/tmwa/buysellhandler.cpp @@ -96,7 +96,7 @@ void BuySellHandler::processNpcBuy(Net::MessageIn &msg) { msg.readInt16("len"); unsigned int sz = 11; - if (Net::getServerFeatures()->haveItemColors()) + if (serverFeatures->haveItemColors()) sz += 1; const unsigned int n_items = (msg.getLength() - 4U) / sz; mBuyDialog = new BuyDialog(mNpcId); @@ -109,7 +109,7 @@ void BuySellHandler::processNpcBuy(Net::MessageIn &msg) msg.readUInt8("type"); const int itemId = msg.readInt16("item id"); uint8_t color = 1; - if (Net::getServerFeatures()->haveItemColors()) + if (serverFeatures->haveItemColors()) color = msg.readUInt8("item color"); mBuyDialog->addItem(itemId, color, 0, value); } diff --git a/src/net/tmwa/charserverhandler.cpp b/src/net/tmwa/charserverhandler.cpp index d386206aa..a6c7ab178 100644 --- a/src/net/tmwa/charserverhandler.cpp +++ b/src/net/tmwa/charserverhandler.cpp @@ -280,11 +280,11 @@ void CharServerHandler::newCharacter(const std::string &name, const int slot, outMsg.writeInt8(static_cast<int8_t>(hairColor), "hair color"); outMsg.writeInt8(0, "unused"); outMsg.writeInt8(static_cast<int8_t>(hairstyle), "hair style"); - if (Net::getServerFeatures()->haveLookSelection()) + if (serverFeatures->haveLookSelection()) outMsg.writeInt8(look, "look"); else outMsg.writeInt8(0, "unused"); - if (Net::getServerFeatures()->haveRaceSelection()) + if (serverFeatures->haveRaceSelection()) outMsg.writeInt8(race, "class"); } diff --git a/src/net/tmwa/chathandler.cpp b/src/net/tmwa/chathandler.cpp index 099649566..0d0c08d90 100644 --- a/src/net/tmwa/chathandler.cpp +++ b/src/net/tmwa/chathandler.cpp @@ -127,7 +127,7 @@ void ChatHandler::talk(const std::string &restrict text, const std::string mes = std::string(localPlayer->getName()).append( " : ").append(text); - if (Net::getServerFeatures()->haveChatChannels() && channel.size() == 3) + if (serverFeatures->haveChatChannels() && channel.size() == 3) { MessageOut outMsg(CMSG_CHAT_MESSAGE2); // Added + 1 in order to let eAthena parse admin commands correctly @@ -236,7 +236,7 @@ void ChatHandler::processRaw(MessageOut &restrict outMsg, void ChatHandler::ignoreAll() const { - if (!Net::getServerFeatures()->haveServerIgnore()) + if (!serverFeatures->haveServerIgnore()) return; MessageOut outMsg(CMSG_IGNORE_ALL); outMsg.writeInt8(0, "flag"); @@ -244,7 +244,7 @@ void ChatHandler::ignoreAll() const void ChatHandler::unIgnoreAll() const { - if (!Net::getServerFeatures()->haveServerIgnore()) + if (!serverFeatures->haveServerIgnore()) return; MessageOut outMsg(CMSG_IGNORE_ALL); outMsg.writeInt8(1, "flag"); diff --git a/src/net/tmwa/guildhandler.cpp b/src/net/tmwa/guildhandler.cpp index 4a7b00147..35b25364b 100644 --- a/src/net/tmwa/guildhandler.cpp +++ b/src/net/tmwa/guildhandler.cpp @@ -85,7 +85,7 @@ GuildHandler::~GuildHandler() void GuildHandler::handleMessage(Net::MessageIn &msg) { BLOCK_START("GuildHandler::handleMessage") - if (!Net::getServerFeatures()->haveNativeGuilds()) + if (!serverFeatures->haveNativeGuilds()) return; switch (msg.getId()) diff --git a/src/net/tmwa/inventoryhandler.cpp b/src/net/tmwa/inventoryhandler.cpp index a1eb1b159..359326e31 100644 --- a/src/net/tmwa/inventoryhandler.cpp +++ b/src/net/tmwa/inventoryhandler.cpp @@ -267,7 +267,7 @@ void InventoryHandler::processPlayerEquipment(Net::MessageIn &msg) index, itemId, itemType, identified); } - if (!Net::getServerFeatures()->haveItemColors() && identified > 1) + if (!serverFeatures->haveItemColors() && identified > 1) identified = 1; if (inventory) @@ -338,7 +338,7 @@ void InventoryHandler::processPlayerInventoryAdd(Net::MessageIn &msg) if (item && item->getId() == itemId) amount += item->getQuantity(); - if (!Net::getServerFeatures()->haveItemColors() && identified > 1) + if (!serverFeatures->haveItemColors() && identified > 1) identified = 1; inventory->setItem(index, itemId, amount, refine, @@ -388,7 +388,7 @@ void InventoryHandler::processPlayerInventory(Net::MessageIn &msg) cards[0], cards[1], cards[2], cards[3]); } - if (!Net::getServerFeatures()->haveItemColors() && identified > 1) + if (!serverFeatures->haveItemColors() && identified > 1) identified = 1; // Trick because arrows are not considered equipment @@ -431,7 +431,7 @@ void InventoryHandler::processPlayerStorage(Net::MessageIn &msg) cards[0], cards[1], cards[2], cards[3]); } - if (!Net::getServerFeatures()->haveItemColors() && identified > 1) + if (!serverFeatures->haveItemColors() && identified > 1) identified = 1; mInventoryItems.push_back(Ea::InventoryItem(index, itemId, @@ -499,7 +499,7 @@ void InventoryHandler::processPlayerStorageEquip(Net::MessageIn &msg) static_cast<unsigned int>(refine)); } - if (!Net::getServerFeatures()->haveItemColors() && identified > 1U) + if (!serverFeatures->haveItemColors() && identified > 1U) identified = 1U; mInventoryItems.push_back(Ea::InventoryItem(index, @@ -530,7 +530,7 @@ void InventoryHandler::processPlayerStorageAdd(Net::MessageIn &msg) { if (mStorage) { - if (!Net::getServerFeatures()->haveItemColors() && identified > 1) + if (!serverFeatures->haveItemColors() && identified > 1) identified = 1; mStorage->setItem(index, itemId, amount, diff --git a/src/net/tmwa/loginhandler.cpp b/src/net/tmwa/loginhandler.cpp index 35321b1b8..bcf0e6c2b 100644 --- a/src/net/tmwa/loginhandler.cpp +++ b/src/net/tmwa/loginhandler.cpp @@ -267,7 +267,7 @@ void LoginHandler::processUpdateHost2(Net::MessageIn &msg) const int LoginHandler::supportedOptionalActions() const { - return Net::getServerFeatures()->haveEmailOnRegister() + return serverFeatures->haveEmailOnRegister() ? Net::RegistrationOptions::SetEmailOnRegister | Net::RegistrationOptions::SetGenderOnRegister : Net::RegistrationOptions::SetGenderOnRegister; diff --git a/src/net/tmwa/npchandler.cpp b/src/net/tmwa/npchandler.cpp index 0718e9b4f..5437d6920 100644 --- a/src/net/tmwa/npchandler.cpp +++ b/src/net/tmwa/npchandler.cpp @@ -180,7 +180,7 @@ void NpcHandler::buyItem(const int beingId A_UNUSED, const int itemId, const unsigned char color, const int amount) const { MessageOut outMsg(CMSG_NPC_BUY_REQUEST); - if (Net::getServerFeatures()->haveItemColors()) + if (serverFeatures->haveItemColors()) { outMsg.writeInt16(10); // One item (length of packet) outMsg.writeInt16(static_cast<int16_t>(amount)); |