From dc4a8bf50b6285079902da824202d29d767b90ec Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 22 Aug 2015 15:45:34 +0300 Subject: Read damaged attribute from all packets. --- src/net/eathena/inventoryhandler.cpp | 8 ++++---- src/net/eathena/itemhandler.cpp | 6 ++++-- src/net/eathena/tradehandler.cpp | 4 ++-- 3 files changed, 10 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/net/eathena/inventoryhandler.cpp b/src/net/eathena/inventoryhandler.cpp index 423679711..45ea1bc3a 100644 --- a/src/net/eathena/inventoryhandler.cpp +++ b/src/net/eathena/inventoryhandler.cpp @@ -803,7 +803,7 @@ void InventoryHandler::processPlayerStorageAdd(Net::MessageIn &msg) const int itemId = msg.readInt16("item id"); const int itemType = msg.readUInt8("type"); const unsigned char identified = msg.readUInt8("identify"); - msg.readUInt8("attribute"); + const Damaged damaged = fromBool(msg.readUInt8("attribute"), Damaged); const uint8_t refine = msg.readUInt8("refine"); int cards[4]; for (int f = 0; f < 4; f++) @@ -826,7 +826,7 @@ void InventoryHandler::processPlayerStorageAdd(Net::MessageIn &msg) refine, color, fromBool(identified, Identified), - Damaged_false, + damaged, Favorite_false, Equipm_false, Equipped_false); @@ -1013,7 +1013,7 @@ void InventoryHandler::processPlayerCartAdd(Net::MessageIn &msg) const int itemId = msg.readInt16("item id"); const int itemType = msg.readUInt8("item type"); uint8_t identified = msg.readUInt8("identified"); - msg.readUInt8("attribute"); + const Damaged damaged = fromBool(msg.readUInt8("attribute"), Damaged); const uint8_t refine = msg.readUInt8("refine"); int cards[4]; for (int f = 0; f < 4; f++) @@ -1033,7 +1033,7 @@ void InventoryHandler::processPlayerCartAdd(Net::MessageIn &msg) refine, ItemColorManager::getColorFromCards(&cards[0]), fromBool(identified, Identified), - Damaged_false, + damaged, Favorite_false, Equipm_false, Equipped_false); diff --git a/src/net/eathena/itemhandler.cpp b/src/net/eathena/itemhandler.cpp index 6bb541649..5ce7a1c6e 100644 --- a/src/net/eathena/itemhandler.cpp +++ b/src/net/eathena/itemhandler.cpp @@ -26,6 +26,8 @@ #include "itemcolormanager.h" #include "logger.h" +#include "enums/simpletypes/damaged.h" + #include "net/eathena/protocol.h" #include "debug.h" @@ -123,7 +125,7 @@ void ItemHandler::processItemDropped2(Net::MessageIn &msg) const int itemType = msg.readUInt8("type"); const Identified identified = fromInt( msg.readUInt8("identify"), Identified); - msg.readUInt8("attribute"); + const Damaged damaged = fromBool(msg.readUInt8("attribute"), Damaged); const uint8_t refine = msg.readUInt8("refine"); int cards[4]; for (int f = 0; f < 4; f++) @@ -208,7 +210,7 @@ void ItemHandler::processItemVisible2(Net::MessageIn &msg) const int itemType = msg.readUInt8("type"); const Identified identified = fromInt( msg.readUInt8("identify"), Identified); - msg.readUInt8("attribute"); + const Damaged damaged = fromBool(msg.readUInt8("attribute"), Damaged); const uint8_t refine = msg.readUInt8("refine"); int cards[4]; for (int f = 0; f < 4; f++) diff --git a/src/net/eathena/tradehandler.cpp b/src/net/eathena/tradehandler.cpp index bc416cff6..537e205f9 100644 --- a/src/net/eathena/tradehandler.cpp +++ b/src/net/eathena/tradehandler.cpp @@ -186,7 +186,7 @@ void TradeHandler::processTradeItemAdd(Net::MessageIn &msg) const int itemType = msg.readUInt8("item type"); const int amount = msg.readInt32("amount"); const uint8_t identify = msg.readUInt8("identify"); - msg.readUInt8("attribute"); + const Damaged damaged = fromBool(msg.readUInt8("attribute"), Damaged); const uint8_t refine = msg.readUInt8("refine"); int cards[4]; for (int f = 0; f < 4; f++) @@ -209,7 +209,7 @@ void TradeHandler::processTradeItemAdd(Net::MessageIn &msg) refine, ItemColorManager::getColorFromCards(&cards[0]), fromBool(identify, Identified), - Damaged_false, + damaged, Favorite_false, Equipm_false); } -- cgit v1.2.3-60-g2f50