summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-06-20 18:18:03 +0300
committerAndrei Karas <akaras@inbox.ru>2015-06-20 18:18:03 +0300
commitcf2a41b8a691e3ecfeef8289cb0a21989ceac882 (patch)
tree4074a3935525877ca5e01bab48714ea5f930d541 /src
parenta111555bd7dbb939673f25f1e8a1f211f61250ad (diff)
downloadmanaverse-cf2a41b8a691e3ecfeef8289cb0a21989ceac882.tar.gz
manaverse-cf2a41b8a691e3ecfeef8289cb0a21989ceac882.tar.bz2
manaverse-cf2a41b8a691e3ecfeef8289cb0a21989ceac882.tar.xz
manaverse-cf2a41b8a691e3ecfeef8289cb0a21989ceac882.zip
Remove from tmwa namespace checks for haveItemColors.
Diffstat (limited to 'src')
-rw-r--r--src/net/tmwa/beinghandler.cpp53
-rw-r--r--src/net/tmwa/buysellhandler.cpp7
-rw-r--r--src/net/tmwa/inventoryhandler.cpp156
-rw-r--r--src/net/tmwa/npchandler.cpp17
-rw-r--r--src/net/tmwa/serverfeatures.cpp12
-rw-r--r--src/net/tmwa/tradehandler.cpp31
6 files changed, 68 insertions, 208 deletions
diff --git a/src/net/tmwa/beinghandler.cpp b/src/net/tmwa/beinghandler.cpp
index 95eb9c111..f5ebfd2f7 100644
--- a/src/net/tmwa/beinghandler.cpp
+++ b/src/net/tmwa/beinghandler.cpp
@@ -293,7 +293,7 @@ void BeingHandler::processBeingChangeLook2(Net::MessageIn &msg)
int id2 = 0;
const int16_t id = msg.readInt16("id1");
- if (type == 2 || serverFeatures->haveItemColors())
+ if (type == 2)
{
id2 = msg.readInt16("id2");
}
@@ -514,20 +514,9 @@ void BeingHandler::processPlayerUpdate1(Net::MessageIn &msg)
// Set these after the gender, as the sprites may be gender-specific
dstBeing->updateSprite(SPRITE_BODY, weapon, "", 1, true);
dstBeing->updateSprite(SPRITE_FLOOR, shield);
- if (serverFeatures->haveItemColors())
- {
- dstBeing->updateSprite(SPRITE_WEAPON, headBottom,
- "", colors[0]);
- dstBeing->updateSprite(SPRITE_HEAD_BOTTOM, headMid, "", colors[2]);
- dstBeing->updateSprite(SPRITE_CLOTHES_COLOR, headTop,
- "", colors[1]);
- }
- else
- {
- dstBeing->updateSprite(SPRITE_WEAPON, headBottom);
- dstBeing->updateSprite(SPRITE_HEAD_BOTTOM, headMid);
- dstBeing->updateSprite(SPRITE_CLOTHES_COLOR, headTop);
- }
+ dstBeing->updateSprite(SPRITE_WEAPON, headBottom);
+ dstBeing->updateSprite(SPRITE_HEAD_BOTTOM, headMid);
+ dstBeing->updateSprite(SPRITE_CLOTHES_COLOR, headTop);
dstBeing->updateSprite(SPRITE_HAIR_COLOR, hairStyle * -1,
ItemDB::get(-hairStyle).getDyeColorsString(hairColor));
dstBeing->setHairColor(hairColor);
@@ -665,20 +654,9 @@ void BeingHandler::processPlayerUpdate2(Net::MessageIn &msg)
// Set these after the gender, as the sprites may be gender-specific
dstBeing->updateSprite(SPRITE_BODY, weapon, "", 1, true);
dstBeing->updateSprite(SPRITE_FLOOR, shield);
- if (serverFeatures->haveItemColors())
- {
- dstBeing->updateSprite(SPRITE_WEAPON, headBottom,
- "", colors[0]);
- dstBeing->updateSprite(SPRITE_HEAD_BOTTOM, headMid, "", colors[2]);
- dstBeing->updateSprite(SPRITE_CLOTHES_COLOR, headTop,
- "", colors[1]);
- }
- else
- {
- dstBeing->updateSprite(SPRITE_WEAPON, headBottom);
- dstBeing->updateSprite(SPRITE_HEAD_BOTTOM, headMid);
- dstBeing->updateSprite(SPRITE_CLOTHES_COLOR, headTop);
- }
+ dstBeing->updateSprite(SPRITE_WEAPON, headBottom);
+ dstBeing->updateSprite(SPRITE_HEAD_BOTTOM, headMid);
+ dstBeing->updateSprite(SPRITE_CLOTHES_COLOR, headTop);
dstBeing->updateSprite(SPRITE_HAIR_COLOR, hairStyle * -1,
ItemDB::get(-hairStyle).getDyeColorsString(hairColor));
dstBeing->setHairColor(hairColor);
@@ -816,20 +794,9 @@ void BeingHandler::processPlayerMove(Net::MessageIn &msg)
// Set these after the gender, as the sprites may be gender-specific
dstBeing->updateSprite(SPRITE_BODY, weapon, "", 1, true);
dstBeing->updateSprite(SPRITE_FLOOR, shield);
- if (serverFeatures->haveItemColors())
- {
- dstBeing->updateSprite(SPRITE_WEAPON, headBottom,
- "", colors[0]);
- dstBeing->updateSprite(SPRITE_HEAD_BOTTOM, headMid, "", colors[2]);
- dstBeing->updateSprite(SPRITE_CLOTHES_COLOR, headTop,
- "", colors[1]);
- }
- else
- {
- dstBeing->updateSprite(SPRITE_WEAPON, headBottom);
- dstBeing->updateSprite(SPRITE_HEAD_BOTTOM, headMid);
- dstBeing->updateSprite(SPRITE_CLOTHES_COLOR, headTop);
- }
+ dstBeing->updateSprite(SPRITE_WEAPON, headBottom);
+ dstBeing->updateSprite(SPRITE_HEAD_BOTTOM, headMid);
+ dstBeing->updateSprite(SPRITE_CLOTHES_COLOR, headTop);
dstBeing->updateSprite(SPRITE_HAIR_COLOR, hairStyle * -1,
ItemDB::get(-hairStyle).getDyeColorsString(hairColor));
dstBeing->setHairColor(hairColor);
diff --git a/src/net/tmwa/buysellhandler.cpp b/src/net/tmwa/buysellhandler.cpp
index a85da12b2..0df127159 100644
--- a/src/net/tmwa/buysellhandler.cpp
+++ b/src/net/tmwa/buysellhandler.cpp
@@ -101,10 +101,7 @@ void BuySellHandler::handleMessage(Net::MessageIn &msg)
void BuySellHandler::processNpcBuy(Net::MessageIn &msg)
{
msg.readInt16("len");
- unsigned int sz = 11;
- if (serverFeatures->haveItemColors())
- sz += 1;
- const unsigned int n_items = (msg.getLength() - 4U) / sz;
+ const unsigned int n_items = (msg.getLength() - 4U) / 11;
CREATEWIDGETV(mBuyDialog, BuyDialog, mNpcId);
mBuyDialog->setMoney(PlayerInfo::getAttribute(Attributes::MONEY));
@@ -115,8 +112,6 @@ void BuySellHandler::processNpcBuy(Net::MessageIn &msg)
const int type = msg.readUInt8("type");
const int itemId = msg.readInt16("item id");
uint8_t color = 1;
- if (serverFeatures->haveItemColors())
- color = msg.readUInt8("item color");
mBuyDialog->addItem(itemId, type, color, 0, value);
}
mBuyDialog->sort();
diff --git a/src/net/tmwa/inventoryhandler.cpp b/src/net/tmwa/inventoryhandler.cpp
index 40bb9a70f..633815ac7 100644
--- a/src/net/tmwa/inventoryhandler.cpp
+++ b/src/net/tmwa/inventoryhandler.cpp
@@ -297,26 +297,13 @@ void InventoryHandler::processPlayerEquipment(Net::MessageIn &msg)
if (inventory)
{
- if (serverFeatures->haveItemColors())
- {
- inventory->setItem(index, itemId, itemType, 1, refine,
- identified,
- Identified_true,
- Damaged_false,
- Favorite_false,
- Equipm_true,
- Equipped_false);
- }
- else
- {
- inventory->setItem(index, itemId, itemType, 1, refine,
- 1,
- fromBool(identified, Identified),
- Damaged_false,
- Favorite_false,
- Equipm_true,
- Equipped_false);
- }
+ inventory->setItem(index, itemId, itemType, 1, refine,
+ 1,
+ fromBool(identified, Identified),
+ Damaged_false,
+ Favorite_false,
+ Equipm_true,
+ Equipped_false);
inventory->setCards(index, cards, 4);
}
@@ -409,26 +396,13 @@ void InventoryHandler::processPlayerInventoryAdd(Net::MessageIn &msg)
if (item && item->getId() == itemId)
amount += item->getQuantity();
- if (serverFeatures->haveItemColors())
- {
- inventory->setItem(index, itemId, type, amount, refine,
- identified,
- Identified_true,
- Damaged_false,
- Favorite_false,
- fromBool(equipType, Equipm),
- Equipped_false);
- }
- else
- {
- inventory->setItem(index, itemId, type, amount, refine,
- 1,
- fromBool(identified, Identified),
- Damaged_false,
- Favorite_false,
- fromBool(equipType, Equipm),
- Equipped_false);
- }
+ inventory->setItem(index, itemId, type, amount, refine,
+ 1,
+ fromBool(identified, Identified),
+ Damaged_false,
+ Favorite_false,
+ fromBool(equipType, Equipm),
+ Equipped_false);
inventory->setCards(index, cards, 4);
}
ArrowsListener::distributeEvent();
@@ -480,26 +454,13 @@ void InventoryHandler::processPlayerInventory(Net::MessageIn &msg)
if (inventory)
{
- if (serverFeatures->haveItemColors())
- {
- inventory->setItem(index, itemId, itemType, amount,
- 0, identified,
- Identified_true,
- Damaged_false,
- Favorite_false,
- fromBool(isEquipment, Equipm),
- Equipped_false);
- }
- else
- {
- inventory->setItem(index, itemId, itemType, amount,
- 0, 1,
- fromBool(identified, Identified),
- Damaged_false,
- Favorite_false,
- fromBool(isEquipment, Equipm),
- Equipped_false);
- }
+ inventory->setItem(index, itemId, itemType, amount,
+ 0, 1,
+ fromBool(identified, Identified),
+ Damaged_false,
+ Favorite_false,
+ fromBool(isEquipment, Equipm),
+ Equipped_false);
inventory->setCards(index, cards, 4);
}
}
@@ -534,24 +495,12 @@ void InventoryHandler::processPlayerStorage(Net::MessageIn &msg)
cards[0], cards[1], cards[2], cards[3]);
}
- if (serverFeatures->haveItemColors())
- {
- mInventoryItems.push_back(Ea::InventoryItem(index, itemId,
- itemType, cards, amount, 0, identified,
- Identified_true,
- Damaged_false,
- Favorite_false,
- Equipm_false));
- }
- else
- {
- mInventoryItems.push_back(Ea::InventoryItem(index, itemId,
- itemType, cards, amount, 0, 1,
- fromBool(identified, Identified),
- Damaged_false,
- Favorite_false,
- Equipm_false));
- }
+ mInventoryItems.push_back(Ea::InventoryItem(index, itemId,
+ itemType, cards, amount, 0, 1,
+ fromBool(identified, Identified),
+ Damaged_false,
+ Favorite_false,
+ Equipm_false));
}
BLOCK_END("InventoryHandler::processPlayerInventory")
}
@@ -615,24 +564,12 @@ void InventoryHandler::processPlayerStorageEquip(Net::MessageIn &msg)
static_cast<unsigned int>(refine));
}
- if (serverFeatures->haveItemColors())
- {
- mInventoryItems.push_back(Ea::InventoryItem(index, itemId,
- itemType, cards, amount, refine, identified,
- Identified_true,
- Damaged_false,
- Favorite_false,
- Equipm_false));
- }
- else
- {
- mInventoryItems.push_back(Ea::InventoryItem(index, itemId,
- itemType, cards, amount, refine, 1,
- fromBool(identified, Identified),
- Damaged_false,
- Favorite_false,
- Equipm_false));
- }
+ mInventoryItems.push_back(Ea::InventoryItem(index, itemId,
+ itemType, cards, amount, refine, 1,
+ fromBool(identified, Identified),
+ Damaged_false,
+ Favorite_false,
+ Equipm_false));
}
BLOCK_END("InventoryHandler::processPlayerStorageEquip")
}
@@ -660,26 +597,13 @@ void InventoryHandler::processPlayerStorageAdd(Net::MessageIn &msg)
{
if (mStorage)
{
- if (serverFeatures->haveItemColors())
- {
- mStorage->setItem(index, itemId, 0, amount,
- refine, identified,
- Identified_true,
- Damaged_false,
- Favorite_false,
- Equipm_false,
- Equipped_false);
- }
- else
- {
- mStorage->setItem(index, itemId, 0, amount,
- refine, 1,
- fromBool(identified, Identified),
- Damaged_false,
- Favorite_false,
- Equipm_false,
- Equipped_false);
- }
+ mStorage->setItem(index, itemId, 0, amount,
+ refine, 1,
+ fromBool(identified, Identified),
+ Damaged_false,
+ Favorite_false,
+ Equipm_false,
+ Equipped_false);
mStorage->setCards(index, cards, 4);
}
}
diff --git a/src/net/tmwa/npchandler.cpp b/src/net/tmwa/npchandler.cpp
index 61a4cf188..efabfff2e 100644
--- a/src/net/tmwa/npchandler.cpp
+++ b/src/net/tmwa/npchandler.cpp
@@ -184,20 +184,9 @@ void NpcHandler::buyItem(const BeingId beingId A_UNUSED,
const int amount) const
{
createOutPacket(CMSG_NPC_BUY_REQUEST);
- if (serverFeatures->haveItemColors())
- {
- outMsg.writeInt16(10, "len");
- outMsg.writeInt16(static_cast<int16_t>(amount), "amount");
- outMsg.writeInt16(static_cast<int16_t>(itemId), "item id");
- outMsg.writeInt8(color, "color");
- outMsg.writeInt8(0, "unused");
- }
- else
- {
- outMsg.writeInt16(8, "len");
- outMsg.writeInt16(static_cast<int16_t>(amount), "amount");
- outMsg.writeInt16(static_cast<int16_t>(itemId), "item id");
- }
+ outMsg.writeInt16(8, "len");
+ outMsg.writeInt16(static_cast<int16_t>(amount), "amount");
+ outMsg.writeInt16(static_cast<int16_t>(itemId), "item id");
}
void NpcHandler::sellItem(const BeingId beingId A_UNUSED,
diff --git a/src/net/tmwa/serverfeatures.cpp b/src/net/tmwa/serverfeatures.cpp
index 25d024e04..928740281 100644
--- a/src/net/tmwa/serverfeatures.cpp
+++ b/src/net/tmwa/serverfeatures.cpp
@@ -61,12 +61,12 @@ bool ServerFeatures::haveServerHp() const
bool ServerFeatures::havePlayerStatusUpdate() const
{
- return serverVersion >= 4;
+ return false;
}
bool ServerFeatures::haveBrokenPlayerAttackDistance() const
{
- return serverVersion < 1;
+ return true;
}
bool ServerFeatures::haveNativeGuilds() const
@@ -81,12 +81,12 @@ bool ServerFeatures::haveIncompleteChatMessages() const
bool ServerFeatures::haveRaceSelection() const
{
- return serverVersion >= 2;
+ return false;
}
bool ServerFeatures::haveLookSelection() const
{
- return serverVersion >= 9;
+ return false;
}
bool ServerFeatures::haveChatChannels() const
@@ -101,12 +101,12 @@ bool ServerFeatures::haveServerIgnore() const
bool ServerFeatures::haveMove3() const
{
- return serverVersion >= 10 || tmwServerVersion >= 0x0f0512;
+ return tmwServerVersion >= 0x0f0512;
}
bool ServerFeatures::haveItemColors() const
{
- return serverVersion >= 1;
+ return false;
}
bool ServerFeatures::haveOtherGender() const
diff --git a/src/net/tmwa/tradehandler.cpp b/src/net/tmwa/tradehandler.cpp
index e48536874..8f9a110df 100644
--- a/src/net/tmwa/tradehandler.cpp
+++ b/src/net/tmwa/tradehandler.cpp
@@ -186,29 +186,14 @@ void TradeHandler::processTradeItemAdd(Net::MessageIn &msg)
}
else
{
- if (serverFeatures->haveItemColors())
- {
- tradeWindow->addItem2(type, 0,
- cards, 4,
- false, amount,
- refine,
- identify,
- Identified_true,
- Damaged_false,
- Favorite_false,
- Equipm_false);
- }
- else
- {
- tradeWindow->addItem2(type, 0,
- cards, 4,
- false, amount,
- refine, 1,
- fromBool(identify, Identified),
- Damaged_false,
- Favorite_false,
- Equipm_false);
- }
+ tradeWindow->addItem2(type, 0,
+ cards, 4,
+ false, amount,
+ refine, 1,
+ fromBool(identify, Identified),
+ Damaged_false,
+ Favorite_false,
+ Equipm_false);
}
}
}