Renamed Inventory to InventoryOld

This commit is contained in:
KimLS
2015-02-17 13:42:21 -08:00
parent b48a712887
commit b75e6308dd
31 changed files with 209 additions and 209 deletions
+2 -2
View File
@@ -3173,7 +3173,7 @@ bool Client::CalcItemScale(uint32 slot_x, uint32 slot_y) {
// TEST CODE: test for bazaar trader crashing with charm items
if (Trader)
if (i >= EmuConstants::GENERAL_BAGS_BEGIN && i <= EmuConstants::GENERAL_BAGS_END) {
ItemInst* parent_item = m_inv.GetItem(Inventory::CalcSlotId(i));
ItemInst* parent_item = m_inv.GetItem(InventoryOld::CalcSlotId(i));
if (parent_item && parent_item->GetItem()->ID == 17899) // trader satchel
continue;
}
@@ -3266,7 +3266,7 @@ bool Client::DoItemEnterZone(uint32 slot_x, uint32 slot_y) {
// TEST CODE: test for bazaar trader crashing with charm items
if (Trader)
if (i >= EmuConstants::GENERAL_BAGS_BEGIN && i <= EmuConstants::GENERAL_BAGS_END) {
ItemInst* parent_item = m_inv.GetItem(Inventory::CalcSlotId(i));
ItemInst* parent_item = m_inv.GetItem(InventoryOld::CalcSlotId(i));
if (parent_item && parent_item->GetItem()->ID == 17899) // trader satchel
continue;
}
+7 -7
View File
@@ -4138,7 +4138,7 @@ void Bot::Spawn(Client* botCharacterOwner, std::string* errorMessage) {
for(int i = EmuConstants::EQUIPMENT_BEGIN; i <= EmuConstants::EQUIPMENT_END; ++i) {
itemID = GetBotItemBySlot(i);
if(itemID != 0) {
materialFromSlot = Inventory::CalcMaterialFromSlot(i);
materialFromSlot = InventoryOld::CalcMaterialFromSlot(i);
if(materialFromSlot != 0xFF)
this->SendWearChange(materialFromSlot);
}
@@ -4191,7 +4191,7 @@ void Bot::RemoveBotItemBySlot(uint32 slotID, std::string *errorMessage) {
}
// Retrieves all the inventory records from the database for this bot.
void Bot::GetBotItems(std::string* errorMessage, Inventory &inv) {
void Bot::GetBotItems(std::string* errorMessage, InventoryOld &inv) {
if(this->GetBotID() == 0)
return;
@@ -5081,7 +5081,7 @@ ItemInst* Bot::GetBotItem(uint32 slotID) {
// Adds the specified item it bot to the NPC equipment array and to the bot inventory collection.
void Bot::BotAddEquipItem(int slot, uint32 id) {
if(slot > 0 && id > 0) {
uint8 materialFromSlot = Inventory::CalcMaterialFromSlot(slot);
uint8 materialFromSlot = InventoryOld::CalcMaterialFromSlot(slot);
if(materialFromSlot != _MaterialInvalid) {
equipment[slot] = id; // npc has more than just material slots. Valid material should mean valid inventory index
@@ -5097,7 +5097,7 @@ void Bot::BotAddEquipItem(int slot, uint32 id) {
// Erases the specified item from bot the NPC equipment array and from the bot inventory collection.
void Bot::BotRemoveEquipItem(int slot) {
if(slot > 0) {
uint8 materialFromSlot = Inventory::CalcMaterialFromSlot(slot);
uint8 materialFromSlot = InventoryOld::CalcMaterialFromSlot(slot);
if(materialFromSlot != _MaterialInvalid) {
equipment[slot] = 0; // npc has more than just material slots. Valid material should mean valid inventory index
@@ -5669,7 +5669,7 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
bool UpdateClient = false;
bool already_returned = false;
Inventory& clientInventory = client->GetInv();
InventoryOld& clientInventory = client->GetInv();
const ItemInst* inst = clientInventory[i];
if(inst) {
items[i] = inst->GetItem()->ID;
@@ -11281,7 +11281,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
if(!results.Success())
return;
uint8 slotmaterial = Inventory::CalcMaterialFromSlot(setslot);
uint8 slotmaterial = InventoryOld::CalcMaterialFromSlot(setslot);
c->GetTarget()->CastToBot()->SendWearChange(slotmaterial);
}
else {
@@ -15974,7 +15974,7 @@ uint32 Bot::GetEquipmentColor(uint8 material_slot) const
uint32 botid = this->GetBotID();
//Translate code slot # to DB slot #
slotid = Inventory::CalcSlotFromMaterial(material_slot);
slotid = InventoryOld::CalcSlotFromMaterial(material_slot);
if (slotid == INVALID_INDEX)
return 0;
+2 -2
View File
@@ -579,7 +579,7 @@ private:
bool _petChooser;
uint8 _petChooserID;
bool berserk;
Inventory m_inv;
InventoryOld m_inv;
double _lastTotalPlayTime;
time_t _startTotalPlayTime;
Mob* _previousTarget;
@@ -651,7 +651,7 @@ private:
void SetBotID(uint32 botID);
// Private "Inventory" Methods
void GetBotItems(std::string* errorMessage, Inventory &inv);
void GetBotItems(std::string* errorMessage, InventoryOld &inv);
void BotRemoveEquipItem(int slot);
void BotAddEquipItem(int slot, uint32 id);
uint32 GetBotItemBySlot(uint32 slotID);
+2 -2
View File
@@ -2705,7 +2705,7 @@ void Client::SetMaterial(int16 in_slot, uint32 item_id) {
const Item_Struct* item = database.GetItem(item_id);
if (item && (item->ItemClass==ItemClassCommon))
{
uint8 matslot = Inventory::CalcMaterialFromSlot(in_slot);
uint8 matslot = InventoryOld::CalcMaterialFromSlot(in_slot);
if (matslot != _MaterialInvalid)
{
m_pp.item_material[matslot] = GetEquipmentMaterial(matslot);
@@ -3047,7 +3047,7 @@ void Client::SetTint(int16 in_slot, uint32 color) {
// Still need to reconcile bracer01 versus bracer02
void Client::SetTint(int16 in_slot, Color_Struct& color) {
uint8 matslot = Inventory::CalcMaterialFromSlot(in_slot);
uint8 matslot = InventoryOld::CalcMaterialFromSlot(in_slot);
if (matslot != _MaterialInvalid)
{
m_pp.item_tint[matslot].color = color.color;
+3 -3
View File
@@ -333,8 +333,8 @@ public:
inline uint8 GetAnon() const { return m_pp.anon; }
inline PlayerProfile_Struct& GetPP() { return m_pp; }
inline ExtendedProfile_Struct& GetEPP() { return m_epp; }
inline Inventory& GetInv() { return m_inv; }
inline const Inventory& GetInv() const { return m_inv; }
inline InventoryOld& GetInv() { return m_inv; }
inline const InventoryOld& GetInv() const { return m_inv; }
inline PetInfo* GetPetInfo(uint16 pet) { return (pet==1)?&m_suspendedminion:&m_petinfo; }
inline InspectMessage_Struct& GetInspectMessage() { return m_inspect_message; }
inline const InspectMessage_Struct& GetInspectMessage() const { return m_inspect_message; }
@@ -1405,7 +1405,7 @@ private:
PlayerProfile_Struct m_pp;
ExtendedProfile_Struct m_epp;
Inventory m_inv;
InventoryOld m_inv;
Object* m_tradeskill_object;
PetInfo m_petinfo; // current pet data, used while loading from and saving to DB
PetInfo m_suspendedminion; // pet data for our suspended minion.
+2 -2
View File
@@ -2969,7 +2969,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app)
{
ItemInst *tobe_auged = nullptr, *auged_with = nullptr;
int8 slot = -1;
Inventory& user_inv = GetInv();
InventoryOld& user_inv = GetInv();
uint16 slot_id = in_augment->container_slot;
uint16 aug_slot_id = in_augment->augment_slot;
@@ -3039,7 +3039,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app)
{
ItemInst *tobe_auged = nullptr, *auged_with = nullptr;
int8 slot = -1;
Inventory& user_inv = GetInv();
InventoryOld& user_inv = GetInv();
uint16 slot_id = in_augment->container_slot;
uint16 aug_slot_id = in_augment->augment_slot; //it's actually solvent slot
+5 -5
View File
@@ -2602,7 +2602,7 @@ void command_peekinv(Client *c, const Seperator *sep)
item_link = linker.GenerateLink();
c->Message((item_data == nullptr), " InvBagSlot: %i (Slot #%i, Bag #%i), Item: %i (%s), Charges: %i",
Inventory::CalcSlotId(indexMain, indexSub), indexMain, indexSub, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_sub == nullptr) ? 0 : inst_sub->GetCharges()));
InventoryOld::CalcSlotId(indexMain, indexSub), indexMain, indexSub, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_sub == nullptr) ? 0 : inst_sub->GetCharges()));
}
}
@@ -2636,7 +2636,7 @@ void command_peekinv(Client *c, const Seperator *sep)
item_link = linker.GenerateLink();
c->Message((item_data == nullptr), " CursorBagSlot: %i (Slot #%i, Bag #%i), Item: %i (%s), Charges: %i",
Inventory::CalcSlotId(MainCursor, indexSub), MainCursor, indexSub, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_sub == nullptr) ? 0 : inst_sub->GetCharges()));
InventoryOld::CalcSlotId(MainCursor, indexSub), MainCursor, indexSub, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_sub == nullptr) ? 0 : inst_sub->GetCharges()));
}
}
}
@@ -2673,7 +2673,7 @@ void command_peekinv(Client *c, const Seperator *sep)
item_link = linker.GenerateLink();
c->Message((item_data == nullptr), " BankBagSlot: %i (Slot #%i, Bag #%i), Item: %i (%s), Charges: %i",
Inventory::CalcSlotId(indexMain, indexSub), indexMain, indexSub, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_sub == nullptr) ? 0 : inst_sub->GetCharges()));
InventoryOld::CalcSlotId(indexMain, indexSub), indexMain, indexSub, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_sub == nullptr) ? 0 : inst_sub->GetCharges()));
}
}
@@ -2695,7 +2695,7 @@ void command_peekinv(Client *c, const Seperator *sep)
item_link = linker.GenerateLink();
c->Message((item_data == nullptr), " SharedBankBagSlot: %i (Slot #%i, Bag #%i), Item: %i (%s), Charges: %i",
Inventory::CalcSlotId(indexMain, indexSub), indexMain, indexSub, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_sub == nullptr) ? 0 : inst_sub->GetCharges()));
InventoryOld::CalcSlotId(indexMain, indexSub), indexMain, indexSub, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_sub == nullptr) ? 0 : inst_sub->GetCharges()));
}
}
@@ -2718,7 +2718,7 @@ void command_peekinv(Client *c, const Seperator *sep)
item_link = linker.GenerateLink();
c->Message((item_data == nullptr), " TradeBagSlot: %i (Slot #%i, Bag #%i), Item: %i (%s), Charges: %i",
Inventory::CalcSlotId(indexMain, indexSub), indexMain, indexSub, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_sub == nullptr) ? 0 : inst_sub->GetCharges()));
InventoryOld::CalcSlotId(indexMain, indexSub), indexMain, indexSub, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_sub == nullptr) ? 0 : inst_sub->GetCharges()));
}
}
+5 -5
View File
@@ -409,7 +409,7 @@ void Corpse::MoveItemToCorpse(Client *client, ItemInst *inst, int16 equipSlot, s
if (equipSlot < EmuConstants::GENERAL_BEGIN || equipSlot > MainCursor) { break; }
for (auto sub_index = SUB_BEGIN; sub_index < EmuConstants::ITEM_CONTAINER_SIZE; ++sub_index) {
int16 real_bag_slot = Inventory::CalcSlotId(equipSlot, sub_index);
int16 real_bag_slot = InventoryOld::CalcSlotId(equipSlot, sub_index);
auto bag_inst = client->GetInv().GetItem(real_bag_slot);
if (bag_inst == nullptr) { continue; }
@@ -683,8 +683,8 @@ ServerLootItem_Struct* Corpse::GetItem(uint16 lootslot, ServerLootItem_Struct**
}
}
if (sitem && bag_item_data && Inventory::SupportsContainers(sitem->equip_slot)) {
int16 bagstart = Inventory::CalcSlotId(sitem->equip_slot, SUB_BEGIN);
if (sitem && bag_item_data && InventoryOld::SupportsContainers(sitem->equip_slot)) {
int16 bagstart = InventoryOld::CalcSlotId(sitem->equip_slot, SUB_BEGIN);
cur = itemlist.begin();
end = itemlist.end();
@@ -738,7 +738,7 @@ void Corpse::RemoveItem(ServerLootItem_Struct* item_data)
is_corpse_changed = true;
itemlist.erase(iter);
uint8 material = Inventory::CalcMaterialFromSlot(sitem->equip_slot); // autos to unsigned char
uint8 material = InventoryOld::CalcMaterialFromSlot(sitem->equip_slot); // autos to unsigned char
if (material != _MaterialInvalid)
SendWearChange(material);
@@ -1397,7 +1397,7 @@ uint32 Corpse::GetEquipment(uint8 material_slot) const {
return NO_ITEM;
}
invslot = Inventory::CalcSlotFromMaterial(material_slot);
invslot = InventoryOld::CalcSlotFromMaterial(material_slot);
if(invslot == INVALID_INDEX) // GetWornItem() should be returning a NO_ITEM for any invalid index...
return NO_ITEM;
+29 -29
View File
@@ -765,7 +765,7 @@ void Client::DeleteItemInInventory(int16 slot_id, int8 quantity, bool client_upd
ItemInst* bagitem = m_inv[slot_id]->GetItem(bag_idx);
if(bagitem) {
int16 bagslot_id = Inventory::CalcSlotId(slot_id, bag_idx);
int16 bagslot_id = InventoryOld::CalcSlotId(slot_id, bag_idx);
qsaudit->items[++parent_offset].char_slot = bagslot_id;
qsaudit->items[parent_offset].item_id = bagitem->GetID();
@@ -864,7 +864,7 @@ bool Client::PutItemInInventory(int16 slot_id, const ItemInst& inst, bool client
if (client_update)
{
SendItemPacket(slot_id, &inst, ((slot_id == MainCursor) ? ItemPacketSummonItem : ItemPacketTrade));
//SendWearChange(Inventory::CalcMaterialFromSlot(slot_id));
//SendWearChange(InventoryOld::CalcMaterialFromSlot(slot_id));
}
if (slot_id == MainCursor) {
@@ -901,7 +901,7 @@ void Client::PutLootInInventory(int16 slot_id, const ItemInst &inst, ServerLootI
if(bag_item_data[i] == nullptr)
continue;
const ItemInst *bagitem = database.CreateItem(bag_item_data[i]->item_id, bag_item_data[i]->charges, bag_item_data[i]->aug_1, bag_item_data[i]->aug_2, bag_item_data[i]->aug_3, bag_item_data[i]->aug_4, bag_item_data[i]->aug_5, bag_item_data[i]->aug_6, bag_item_data[i]->attuned);
interior_slot = Inventory::CalcSlotId(slot_id, i);
interior_slot = InventoryOld::CalcSlotId(slot_id, i);
Log.Out(Logs::Detail, Logs::Inventory, "Putting bag loot item %s (%d) into slot %d (bag slot %d)", inst.GetItem()->Name, inst.GetItem()->ID, interior_slot, i);
PutLootInInventory(interior_slot, *bagitem);
safe_delete(bagitem);
@@ -928,7 +928,7 @@ bool Client::TryStacking(ItemInst* item, uint8 type, bool try_worn, bool try_cur
}
for (i = EmuConstants::GENERAL_BEGIN; i <= EmuConstants::GENERAL_END; i++) {
for (uint8 j = SUB_BEGIN; j < EmuConstants::ITEM_CONTAINER_SIZE; j++) {
uint16 slotid = Inventory::CalcSlotId(i, j);
uint16 slotid = InventoryOld::CalcSlotId(i, j);
ItemInst* tmp_inst = m_inv.GetItem(slotid);
if(tmp_inst && tmp_inst->GetItem()->ID == item_id && tmp_inst->GetCharges() < tmp_inst->GetItem()->StackSize) {
@@ -981,7 +981,7 @@ bool Client::AutoPutLootInInventory(ItemInst& inst, bool try_worn, bool try_curs
if (inst.IsEquipable(i)) { // Equippable at this slot?
//send worn to everyone...
PutLootInInventory(i, inst);
uint8 worn_slot_material = Inventory::CalcMaterialFromSlot(i);
uint8 worn_slot_material = InventoryOld::CalcMaterialFromSlot(i);
if (worn_slot_material != _MaterialInvalid) {
SendWearChange(worn_slot_material);
}
@@ -1481,8 +1481,8 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
if(src_slot_id >= EmuConstants::SHARED_BANK_BEGIN && src_slot_id <= EmuConstants::SHARED_BANK_END && src_inst->IsType(ItemClassContainer)){
for (uint8 idx = SUB_BEGIN; idx < EmuConstants::ITEM_CONTAINER_SIZE; idx++) {
const ItemInst* baginst = src_inst->GetItem(idx);
if(baginst && !database.VerifyInventory(account_id, Inventory::CalcSlotId(src_slot_id, idx), baginst)){
DeleteItemInInventory(Inventory::CalcSlotId(src_slot_id, idx),0,false);
if(baginst && !database.VerifyInventory(account_id, InventoryOld::CalcSlotId(src_slot_id, idx), baginst)){
DeleteItemInInventory(InventoryOld::CalcSlotId(src_slot_id, idx),0,false);
}
}
}
@@ -1496,8 +1496,8 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
if(dst_slot_id >= EmuConstants::SHARED_BANK_BEGIN && dst_slot_id <= EmuConstants::SHARED_BANK_END && dst_inst->IsType(ItemClassContainer)){
for (uint8 idx = SUB_BEGIN; idx < EmuConstants::ITEM_CONTAINER_SIZE; idx++) {
const ItemInst* baginst = dst_inst->GetItem(idx);
if(baginst && !database.VerifyInventory(account_id, Inventory::CalcSlotId(dst_slot_id, idx), baginst)){
DeleteItemInInventory(Inventory::CalcSlotId(dst_slot_id, idx),0,false);
if(baginst && !database.VerifyInventory(account_id, InventoryOld::CalcSlotId(dst_slot_id, idx), baginst)){
DeleteItemInInventory(InventoryOld::CalcSlotId(dst_slot_id, idx),0,false);
}
}
}
@@ -1539,7 +1539,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
if(m_tradeskill_object != nullptr) {
if (src_slot_id >= EmuConstants::WORLD_BEGIN && src_slot_id <= EmuConstants::WORLD_END) {
// Picking up item from world container
ItemInst* inst = m_tradeskill_object->PopItem(Inventory::CalcBagIdx(src_slot_id));
ItemInst* inst = m_tradeskill_object->PopItem(InventoryOld::CalcBagIdx(src_slot_id));
if (inst) {
PutItemInInventory(dst_slot_id, *inst, false);
safe_delete(inst);
@@ -1551,7 +1551,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
}
else if (dst_slot_id >= EmuConstants::WORLD_BEGIN && dst_slot_id <= EmuConstants::WORLD_END) {
// Putting item into world container, which may swap (or pile onto) with existing item
uint8 world_idx = Inventory::CalcBagIdx(dst_slot_id);
uint8 world_idx = InventoryOld::CalcBagIdx(dst_slot_id);
ItemInst* world_inst = m_tradeskill_object->PopItem(world_idx);
// Case 1: No item in container, unidirectional "Put"
@@ -1798,7 +1798,7 @@ void Client::SwapItemResync(MoveItem_Struct* move_slots) {
Message(15, "Inventory Desyncronization detected: Resending slot data...");
if((move_slots->from_slot >= EmuConstants::EQUIPMENT_BEGIN && move_slots->from_slot <= EmuConstants::CURSOR_BAG_END) || move_slots->from_slot == MainPowerSource) {
int16 resync_slot = (Inventory::CalcSlotId(move_slots->from_slot) == INVALID_INDEX) ? move_slots->from_slot : Inventory::CalcSlotId(move_slots->from_slot);
int16 resync_slot = (InventoryOld::CalcSlotId(move_slots->from_slot) == INVALID_INDEX) ? move_slots->from_slot : InventoryOld::CalcSlotId(move_slots->from_slot);
if (IsValidSlot(resync_slot) && resync_slot != INVALID_INDEX) {
// This prevents the client from crashing when closing any 'phantom' bags -U
const Item_Struct* token_struct = database.GetItem(22292); // 'Copper Coin'
@@ -1823,7 +1823,7 @@ void Client::SwapItemResync(MoveItem_Struct* move_slots) {
else { Message(13, "Could not resyncronize source slot %i.", move_slots->from_slot); }
}
else {
int16 resync_slot = (Inventory::CalcSlotId(move_slots->from_slot) == INVALID_INDEX) ? move_slots->from_slot : Inventory::CalcSlotId(move_slots->from_slot);
int16 resync_slot = (InventoryOld::CalcSlotId(move_slots->from_slot) == INVALID_INDEX) ? move_slots->from_slot : InventoryOld::CalcSlotId(move_slots->from_slot);
if (IsValidSlot(resync_slot) && resync_slot != INVALID_INDEX) {
if(m_inv[resync_slot]) {
const Item_Struct* token_struct = database.GetItem(22292); // 'Copper Coin'
@@ -1841,7 +1841,7 @@ void Client::SwapItemResync(MoveItem_Struct* move_slots) {
}
if((move_slots->to_slot >= EmuConstants::EQUIPMENT_BEGIN && move_slots->to_slot <= EmuConstants::CURSOR_BAG_END) || move_slots->to_slot == MainPowerSource) {
int16 resync_slot = (Inventory::CalcSlotId(move_slots->to_slot) == INVALID_INDEX) ? move_slots->to_slot : Inventory::CalcSlotId(move_slots->to_slot);
int16 resync_slot = (InventoryOld::CalcSlotId(move_slots->to_slot) == INVALID_INDEX) ? move_slots->to_slot : InventoryOld::CalcSlotId(move_slots->to_slot);
if (IsValidSlot(resync_slot) && resync_slot != INVALID_INDEX) {
const Item_Struct* token_struct = database.GetItem(22292); // 'Copper Coin'
ItemInst* token_inst = database.CreateItem(token_struct, 1);
@@ -1865,7 +1865,7 @@ void Client::SwapItemResync(MoveItem_Struct* move_slots) {
else { Message(13, "Could not resyncronize destination slot %i.", move_slots->to_slot); }
}
else {
int16 resync_slot = (Inventory::CalcSlotId(move_slots->to_slot) == INVALID_INDEX) ? move_slots->to_slot : Inventory::CalcSlotId(move_slots->to_slot);
int16 resync_slot = (InventoryOld::CalcSlotId(move_slots->to_slot) == INVALID_INDEX) ? move_slots->to_slot : InventoryOld::CalcSlotId(move_slots->to_slot);
if (IsValidSlot(resync_slot) && resync_slot != INVALID_INDEX) {
if(m_inv[resync_slot]) {
const Item_Struct* token_struct = database.GetItem(22292); // 'Copper Coin'
@@ -1925,8 +1925,8 @@ void Client::QSSwapItemAuditor(MoveItem_Struct* move_in, bool postaction_call) {
const ItemInst* from_baginst = from_inst->GetItem(bag_idx);
if(from_baginst) {
qsaudit->items[move_count].from_slot = Inventory::CalcSlotId(from_slot_id, bag_idx);
qsaudit->items[move_count].to_slot = Inventory::CalcSlotId(to_slot_id, bag_idx);
qsaudit->items[move_count].from_slot = InventoryOld::CalcSlotId(from_slot_id, bag_idx);
qsaudit->items[move_count].to_slot = InventoryOld::CalcSlotId(to_slot_id, bag_idx);
qsaudit->items[move_count].item_id = from_baginst->GetID();
qsaudit->items[move_count].charges = from_baginst->GetCharges();
qsaudit->items[move_count].aug_1 = from_baginst->GetAugmentItemID(1);
@@ -1958,8 +1958,8 @@ void Client::QSSwapItemAuditor(MoveItem_Struct* move_in, bool postaction_call) {
const ItemInst* to_baginst = to_inst->GetItem(bag_idx);
if(to_baginst) {
qsaudit->items[move_count].from_slot = Inventory::CalcSlotId(to_slot_id, bag_idx);
qsaudit->items[move_count].to_slot = Inventory::CalcSlotId(from_slot_id, bag_idx);
qsaudit->items[move_count].from_slot = InventoryOld::CalcSlotId(to_slot_id, bag_idx);
qsaudit->items[move_count].to_slot = InventoryOld::CalcSlotId(from_slot_id, bag_idx);
qsaudit->items[move_count].item_id = to_baginst->GetID();
qsaudit->items[move_count].charges = to_baginst->GetCharges();
qsaudit->items[move_count].aug_1 = to_baginst->GetAugmentItemID(1);
@@ -2382,7 +2382,7 @@ uint32 Client::GetEquipment(uint8 material_slot) const
return 0;
}
invslot = Inventory::CalcSlotFromMaterial(material_slot);
invslot = InventoryOld::CalcSlotFromMaterial(material_slot);
if (invslot == INVALID_INDEX)
{
return 0;
@@ -2560,7 +2560,7 @@ void Client::SetBandolier(const EQApplicationPacket *app) {
if (slot == INVALID_INDEX) {
if (m_inv.GetItem(MainCursor)) {
if (m_inv.GetItem(MainCursor)->GetItem()->ID == m_pp.bandoliers[bss->number].items[BandolierSlot].item_id &&
m_inv.GetItem(MainCursor)->GetCharges() >= 1) { // '> 0' the same, but this matches Inventory::_HasItem conditional check
m_inv.GetItem(MainCursor)->GetCharges() >= 1) { // '> 0' the same, but this matches InventoryOld::_HasItem conditional check
slot = MainCursor;
}
else if (m_inv.GetItem(MainCursor)->GetItem()->ItemClass == 1) {
@@ -2736,7 +2736,7 @@ bool Client::MoveItemToInventory(ItemInst *ItemToReturn, bool UpdateClient) {
//
if (InvItem && InvItem->IsType(ItemClassContainer)) {
int16 BaseSlotID = Inventory::CalcSlotId(i, SUB_BEGIN);
int16 BaseSlotID = InventoryOld::CalcSlotId(i, SUB_BEGIN);
uint8 BagSize=InvItem->GetItem()->BagSlots;
@@ -2786,9 +2786,9 @@ bool Client::MoveItemToInventory(ItemInst *ItemToReturn, bool UpdateClient) {
return true;
}
if(InvItem->IsType(ItemClassContainer) && Inventory::CanItemFitInContainer(ItemToReturn->GetItem(), InvItem->GetItem())) {
if(InvItem->IsType(ItemClassContainer) && InventoryOld::CanItemFitInContainer(ItemToReturn->GetItem(), InvItem->GetItem())) {
int16 BaseSlotID = Inventory::CalcSlotId(i, SUB_BEGIN);
int16 BaseSlotID = InventoryOld::CalcSlotId(i, SUB_BEGIN);
uint8 BagSize=InvItem->GetItem()->BagSlots;
@@ -3052,7 +3052,7 @@ bool Client::InterrogateInventory_error(int16 head, int16 index, const ItemInst*
return false;
}
void Inventory::SetCustomItemData(uint32 character_id, int16 slot_id, std::string identifier, std::string value) {
void InventoryOld::SetCustomItemData(uint32 character_id, int16 slot_id, std::string identifier, std::string value) {
ItemInst *inst = GetItem(slot_id);
if(inst) {
inst->SetCustomData(identifier, value);
@@ -3060,7 +3060,7 @@ void Inventory::SetCustomItemData(uint32 character_id, int16 slot_id, std::strin
}
}
void Inventory::SetCustomItemData(uint32 character_id, int16 slot_id, std::string identifier, int value) {
void InventoryOld::SetCustomItemData(uint32 character_id, int16 slot_id, std::string identifier, int value) {
ItemInst *inst = GetItem(slot_id);
if(inst) {
inst->SetCustomData(identifier, value);
@@ -3068,7 +3068,7 @@ void Inventory::SetCustomItemData(uint32 character_id, int16 slot_id, std::strin
}
}
void Inventory::SetCustomItemData(uint32 character_id, int16 slot_id, std::string identifier, float value) {
void InventoryOld::SetCustomItemData(uint32 character_id, int16 slot_id, std::string identifier, float value) {
ItemInst *inst = GetItem(slot_id);
if(inst) {
inst->SetCustomData(identifier, value);
@@ -3076,7 +3076,7 @@ void Inventory::SetCustomItemData(uint32 character_id, int16 slot_id, std::strin
}
}
void Inventory::SetCustomItemData(uint32 character_id, int16 slot_id, std::string identifier, bool value) {
void InventoryOld::SetCustomItemData(uint32 character_id, int16 slot_id, std::string identifier, bool value) {
ItemInst *inst = GetItem(slot_id);
if(inst) {
inst->SetCustomData(identifier, value);
@@ -3084,7 +3084,7 @@ void Inventory::SetCustomItemData(uint32 character_id, int16 slot_id, std::strin
}
}
std::string Inventory::GetCustomItemData(int16 slot_id, std::string identifier) {
std::string InventoryOld::GetCustomItemData(int16 slot_id, std::string identifier) {
ItemInst *inst = GetItem(slot_id);
if(inst) {
return inst->GetCustomData(identifier);
+1 -1
View File
@@ -164,7 +164,7 @@ int Lua_Inventory::GetSlotByItemInst(Lua_ItemInst inst) {
}
luabind::scope lua_register_inventory() {
return luabind::class_<Lua_Inventory>("Inventory")
return luabind::class_<Lua_Inventory>("InventoryOld")
.def(luabind::constructor<>())
.def("GetItem", (Lua_ItemInst(Lua_Inventory::*)(int))&Lua_Inventory::GetItem)
.def("GetItem", (Lua_ItemInst(Lua_Inventory::*)(int,int))&Lua_Inventory::GetItem)
+6 -6
View File
@@ -4,7 +4,7 @@
#include "lua_ptr.h"
class Inventory;
class InventoryOld;
class Lua_ItemInst;
class Lua_Item;
@@ -14,16 +14,16 @@ namespace luabind {
luabind::scope lua_register_inventory();
class Lua_Inventory : public Lua_Ptr<Inventory>
class Lua_Inventory : public Lua_Ptr<InventoryOld>
{
typedef Inventory NativeType;
typedef InventoryOld NativeType;
public:
Lua_Inventory() : Lua_Ptr(nullptr) { }
Lua_Inventory(Inventory *d) : Lua_Ptr(d) { }
Lua_Inventory(InventoryOld *d) : Lua_Ptr(d) { }
virtual ~Lua_Inventory() { }
operator Inventory*() {
return reinterpret_cast<Inventory*>(GetLuaPtrData());
operator InventoryOld*() {
return reinterpret_cast<InventoryOld*>(GetLuaPtrData());
}
Lua_ItemInst GetItem(int slot_id);
+1 -1
View File
@@ -5022,7 +5022,7 @@ void Merc::UpdateMercAppearance() {
for(int i = EmuConstants::EQUIPMENT_BEGIN; i <= EmuConstants::EQUIPMENT_END; ++i) {
itemID = equipment[i];
if(itemID != NO_ITEM) {
materialFromSlot = Inventory::CalcMaterialFromSlot(i);
materialFromSlot = InventoryOld::CalcMaterialFromSlot(i);
if(materialFromSlot != _MaterialInvalid)
this->SendWearChange(materialFromSlot);
}
+1 -1
View File
@@ -381,7 +381,7 @@ private:
uint8 _OwnerClientVersion;
uint32 _currentStance;
Inventory m_inv;
InventoryOld m_inv;
int32 max_end;
int32 cur_end;
bool _medding;
+3 -3
View File
@@ -2547,7 +2547,7 @@ uint32 NPC::GetEquipment(uint8 material_slot) const
{
if(material_slot > 8)
return 0;
int16 invslot = Inventory::CalcSlotFromMaterial(material_slot);
int16 invslot = InventoryOld::CalcSlotFromMaterial(material_slot);
if (invslot == INVALID_INDEX)
return 0;
return equipment[invslot];
@@ -2645,7 +2645,7 @@ int32 Mob::GetEquipmentMaterial(uint8 material_slot) const
{
if (this->IsClient())
{
int16 invslot = Inventory::CalcSlotFromMaterial(material_slot);
int16 invslot = InventoryOld::CalcSlotFromMaterial(material_slot);
if (invslot == INVALID_INDEX)
{
return 0;
@@ -2690,7 +2690,7 @@ int32 Mob::GetHerosForgeModel(uint8 material_slot) const
uint32 ornamentationAugtype = RuleI(Character, OrnamentationAugmentType);
const Item_Struct *item;
item = database.GetItem(GetEquipment(material_slot));
int16 invslot = Inventory::CalcSlotFromMaterial(material_slot);
int16 invslot = InventoryOld::CalcSlotFromMaterial(material_slot);
if (item != 0 && invslot != INVALID_INDEX)
{
+2 -2
View File
@@ -473,7 +473,7 @@ void NPC::CheckMinMaxLevel(Mob *them)
if(themlevel < (*cur)->min_level || themlevel > (*cur)->max_level)
{
material = Inventory::CalcMaterialFromSlot((*cur)->equip_slot);
material = InventoryOld::CalcMaterialFromSlot((*cur)->equip_slot);
if (material != _MaterialInvalid)
SendWearChange(material);
@@ -1285,7 +1285,7 @@ int32 NPC::GetEquipmentMaterial(uint8 material_slot) const
if (material_slot >= _MaterialCount)
return 0;
int16 invslot = Inventory::CalcSlotFromMaterial(material_slot);
int16 invslot = InventoryOld::CalcSlotFromMaterial(material_slot);
if (invslot == INVALID_INDEX)
return 0;
+7 -7
View File
@@ -55,7 +55,7 @@ void Object::HandleAugmentation(Client* user, const AugmentItem_Struct* in_augme
else
{
// Check to see if they have an inventory container type 53 that is used for this.
Inventory& user_inv = user->GetInv();
InventoryOld& user_inv = user->GetInv();
ItemInst* inst = nullptr;
inst = user_inv.GetItem(in_augment->container_slot);
@@ -218,7 +218,7 @@ void Object::HandleAugmentation(Client* user, const AugmentItem_Struct* in_augme
const ItemInst* inst = container->GetItem(i);
if (inst)
{
user->DeleteItemInInventory(Inventory::CalcSlotId(in_augment->container_slot,i),0,true);
user->DeleteItemInInventory(InventoryOld::CalcSlotId(in_augment->container_slot,i),0,true);
}
}
// Explicitly mark container as cleared.
@@ -247,7 +247,7 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob
return;
}
Inventory& user_inv = user->GetInv();
InventoryOld& user_inv = user->GetInv();
PlayerProfile_Struct& user_pp = user->GetPP();
ItemInst* container = nullptr;
ItemInst* inst = nullptr;
@@ -286,7 +286,7 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob
bool AllowAll = RuleB(Inventory, AllowAnyWeaponTransformation);
if (inst && ItemInst::CanTransform(inst->GetItem(), container->GetItem(), AllowAll)) {
const Item_Struct* new_weapon = inst->GetItem();
user->DeleteItemInInventory(Inventory::CalcSlotId(in_combine->container_slot, 0), 0, true);
user->DeleteItemInInventory(InventoryOld::CalcSlotId(in_combine->container_slot, 0), 0, true);
container->Clear();
user->SummonItem(new_weapon->ID, inst->GetCharges(), inst->GetAugmentItemID(0), inst->GetAugmentItemID(1), inst->GetAugmentItemID(2), inst->GetAugmentItemID(3), inst->GetAugmentItemID(4), inst->GetAugmentItemID(5), inst->IsAttuned(), MainCursor, container->GetItem()->Icon, atoi(container->GetItem()->IDFile + 2));
user->Message_StringID(4, TRANSFORM_COMPLETE, inst->GetItem()->Name);
@@ -306,7 +306,7 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob
const ItemInst* inst = container->GetItem(0);
if (inst && inst->GetOrnamentationIcon() && inst->GetOrnamentationIcon()) {
const Item_Struct* new_weapon = inst->GetItem();
user->DeleteItemInInventory(Inventory::CalcSlotId(in_combine->container_slot, 0), 0, true);
user->DeleteItemInInventory(InventoryOld::CalcSlotId(in_combine->container_slot, 0), 0, true);
container->Clear();
user->SummonItem(new_weapon->ID, inst->GetCharges(), inst->GetAugmentItemID(0), inst->GetAugmentItemID(1), inst->GetAugmentItemID(2), inst->GetAugmentItemID(3), inst->GetAugmentItemID(4), inst->GetAugmentItemID(5), inst->IsAttuned(), MainCursor, 0, 0);
user->Message_StringID(4, TRANSFORM_COMPLETE, inst->GetItem()->Name);
@@ -395,7 +395,7 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob
for (uint8 i = MAIN_BEGIN; i < EmuConstants::MAP_WORLD_SIZE; i++) {
const ItemInst* inst = container->GetItem(i);
if (inst) {
user->DeleteItemInInventory(Inventory::CalcSlotId(in_combine->container_slot,i),0,true);
user->DeleteItemInInventory(InventoryOld::CalcSlotId(in_combine->container_slot,i),0,true);
}
}
container->Clear();
@@ -492,7 +492,7 @@ void Object::HandleAutoCombine(Client* user, const RecipeAutoCombine_Struct* rac
memset(counts, 0, sizeof(counts));
//search for all the items in their inventory
Inventory& user_inv = user->GetInv();
InventoryOld& user_inv = user->GetInv();
uint8 count = 0;
uint8 needcount = 0;
+11 -11
View File
@@ -174,7 +174,7 @@ void Trade::SendItemData(const ItemInst* inst, int16 dest_slot_id)
with->SendItemPacket(dest_slot_id - EmuConstants::TRADE_BEGIN, inst, ItemPacketTradeView);
if (inst->GetItem()->ItemClass == 1) {
for (uint16 i = SUB_BEGIN; i < EmuConstants::ITEM_CONTAINER_SIZE; i++) {
uint16 bagslot_id = Inventory::CalcSlotId(dest_slot_id, i);
uint16 bagslot_id = InventoryOld::CalcSlotId(dest_slot_id, i);
const ItemInst* bagitem = trader->GetInv().GetItem(bagslot_id);
if (bagitem) {
with->SendItemPacket(bagslot_id - EmuConstants::TRADE_BEGIN, bagitem, ItemPacketTradeView);
@@ -317,7 +317,7 @@ void Trade::DumpTrade()
if (inst) {
Log.Out(Logs::Detail, Logs::Trading, "\tBagItem %i (Charges=%i, Slot=%i)",
inst->GetItem()->ID, inst->GetCharges(),
Inventory::CalcSlotId(i, j));
InventoryOld::CalcSlotId(i, j));
}
}
}
@@ -368,7 +368,7 @@ void Client::ResetTrade() {
break;
if (partial_inst->GetID() != inst->GetID()) {
Log.Out(Logs::Detail, Logs::None, "[CLIENT] Client::ResetTrade() - an incompatible location reference was returned by Inventory::FindFreeSlotForTradeItem()");
Log.Out(Logs::Detail, Logs::None, "[CLIENT] Client::ResetTrade() - an incompatible location reference was returned by InventoryOld::FindFreeSlotForTradeItem()");
break;
}
@@ -530,9 +530,9 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
detail = new QSTradeItems_Struct;
detail->from_id = this->character_id;
detail->from_slot = Inventory::CalcSlotId(trade_slot, sub_slot);
detail->from_slot = InventoryOld::CalcSlotId(trade_slot, sub_slot);
detail->to_id = other->CharacterID();
detail->to_slot = Inventory::CalcSlotId(free_slot, sub_slot);
detail->to_slot = InventoryOld::CalcSlotId(free_slot, sub_slot);
detail->item_id = bag_inst->GetID();
detail->charges = (!bag_inst->IsStackable() ? 1 : bag_inst->GetCharges());
detail->aug_1 = bag_inst->GetAugmentItemID(1);
@@ -588,7 +588,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
break;
if (partial_inst->GetID() != inst->GetID()) {
Log.Out(Logs::Detail, Logs::Trading, "[CLIENT] Client::ResetTrade() - an incompatible location reference was returned by Inventory::FindFreeSlotForTradeItem()");
Log.Out(Logs::Detail, Logs::Trading, "[CLIENT] Client::ResetTrade() - an incompatible location reference was returned by InventoryOld::FindFreeSlotForTradeItem()");
break;
}
@@ -849,7 +849,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
strcpy(detail->action_type, "HANDIN");
detail->char_slot = Inventory::CalcSlotId(trade_slot, sub_slot);
detail->char_slot = InventoryOld::CalcSlotId(trade_slot, sub_slot);
detail->item_id = trade_baginst->GetID();
detail->charges = (!trade_inst->IsStackable() ? 1 : trade_inst->GetCharges());
detail->aug_1 = trade_baginst->GetAugmentItemID(1);
@@ -1237,7 +1237,7 @@ uint32 Client::FindTraderItemSerialNumber(int32 ItemID) {
if (item && item->GetItem()->ID == 17899){ //Traders Satchel
for (int x = SUB_BEGIN; x < EmuConstants::ITEM_CONTAINER_SIZE; x++) {
// we already have the parent bag and a contents iterator..why not just iterate the bag!??
SlotID = Inventory::CalcSlotId(i, x);
SlotID = InventoryOld::CalcSlotId(i, x);
item = this->GetInv().GetItem(SlotID);
if (item) {
if (item->GetID() == ItemID)
@@ -1260,7 +1260,7 @@ ItemInst* Client::FindTraderItemBySerialNumber(int32 SerialNumber){
if(item && item->GetItem()->ID == 17899){ //Traders Satchel
for(int x = SUB_BEGIN; x < EmuConstants::ITEM_CONTAINER_SIZE; x++) {
// we already have the parent bag and a contents iterator..why not just iterate the bag!??
SlotID = Inventory::CalcSlotId(i, x);
SlotID = InventoryOld::CalcSlotId(i, x);
item = this->GetInv().GetItem(SlotID);
if(item) {
if(item->GetSerialNumber() == SerialNumber)
@@ -1290,7 +1290,7 @@ GetItems_Struct* Client::GetTraderItems(){
item = this->GetInv().GetItem(i);
if(item && item->GetItem()->ID == 17899){ //Traders Satchel
for(int x = SUB_BEGIN; x < EmuConstants::ITEM_CONTAINER_SIZE; x++) {
SlotID = Inventory::CalcSlotId(i, x);
SlotID = InventoryOld::CalcSlotId(i, x);
item = this->GetInv().GetItem(SlotID);
@@ -1314,7 +1314,7 @@ uint16 Client::FindTraderItem(int32 SerialNumber, uint16 Quantity){
item = this->GetInv().GetItem(i);
if(item && item->GetItem()->ID == 17899){ //Traders Satchel
for(int x = SUB_BEGIN; x < EmuConstants::ITEM_CONTAINER_SIZE; x++){
SlotID = Inventory::CalcSlotId(i, x);
SlotID = InventoryOld::CalcSlotId(i, x);
item = this->GetInv().GetItem(SlotID);
+1 -1
View File
@@ -1173,7 +1173,7 @@ bool Zone::Process() {
if(spawn2_timer.Check()) {
LinkedListIterator<Spawn2*> iterator(spawn2_list);
Inventory::CleanDirty();
InventoryOld::CleanDirty();
iterator.Reset();
while (iterator.MoreElements()) {