mirror of
https://github.com/EQEmu/Server.git
synced 2026-09-02 08:26:36 +00:00
Eliminated the nested class design of recent EQEmu work; Some more inv2 convergence work
This commit is contained in:
+106
-106
@@ -35,7 +35,7 @@ uint32 Client::NukeItem(uint32 itemnum, uint8 where_to_check) {
|
||||
|
||||
int i;
|
||||
if(where_to_check & invWhereWorn) {
|
||||
for (i = EQEmu::Constants::EQUIPMENT_BEGIN; i <= EQEmu::Constants::EQUIPMENT_END; i++) {
|
||||
for (i = EQEmu::constants::EQUIPMENT_BEGIN; i <= EQEmu::constants::EQUIPMENT_END; i++) {
|
||||
if (GetItemIDAt(i) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(i) != INVALID_ID)) {
|
||||
cur = m_inv.GetItem(i);
|
||||
if(cur && cur->GetItem()->Stackable) {
|
||||
@@ -75,7 +75,7 @@ uint32 Client::NukeItem(uint32 itemnum, uint8 where_to_check) {
|
||||
DeleteItemInInventory(SlotCursor, 0, true);
|
||||
}
|
||||
|
||||
for (i = EQEmu::Constants::CURSOR_BAG_BEGIN; i <= EQEmu::Constants::CURSOR_BAG_END; i++) {
|
||||
for (i = EQEmu::constants::CURSOR_BAG_BEGIN; i <= EQEmu::constants::CURSOR_BAG_END; i++) {
|
||||
if (GetItemIDAt(i) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(i) != INVALID_ID)) {
|
||||
cur = m_inv.GetItem(i);
|
||||
if(cur && cur->GetItem()->Stackable) {
|
||||
@@ -90,7 +90,7 @@ uint32 Client::NukeItem(uint32 itemnum, uint8 where_to_check) {
|
||||
}
|
||||
|
||||
if(where_to_check & invWherePersonal) {
|
||||
for (i = EQEmu::Constants::GENERAL_BEGIN; i <= EQEmu::Constants::GENERAL_END; i++) {
|
||||
for (i = EQEmu::constants::GENERAL_BEGIN; i <= EQEmu::constants::GENERAL_END; i++) {
|
||||
if (GetItemIDAt(i) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(i) != INVALID_ID)) {
|
||||
cur = m_inv.GetItem(i);
|
||||
if(cur && cur->GetItem()->Stackable) {
|
||||
@@ -103,7 +103,7 @@ uint32 Client::NukeItem(uint32 itemnum, uint8 where_to_check) {
|
||||
}
|
||||
}
|
||||
|
||||
for (i = EQEmu::Constants::GENERAL_BAGS_BEGIN; i <= EQEmu::Constants::GENERAL_BAGS_END; i++) {
|
||||
for (i = EQEmu::constants::GENERAL_BAGS_BEGIN; i <= EQEmu::constants::GENERAL_BAGS_END; i++) {
|
||||
if (GetItemIDAt(i) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(i) != INVALID_ID)) {
|
||||
cur = m_inv.GetItem(i);
|
||||
if(cur && cur->GetItem()->Stackable) {
|
||||
@@ -118,7 +118,7 @@ uint32 Client::NukeItem(uint32 itemnum, uint8 where_to_check) {
|
||||
}
|
||||
|
||||
if(where_to_check & invWhereBank) {
|
||||
for (i = EQEmu::Constants::BANK_BEGIN; i <= EQEmu::Constants::BANK_END; i++) {
|
||||
for (i = EQEmu::constants::BANK_BEGIN; i <= EQEmu::constants::BANK_END; i++) {
|
||||
if (GetItemIDAt(i) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(i) != INVALID_ID)) {
|
||||
cur = m_inv.GetItem(i);
|
||||
if(cur && cur->GetItem()->Stackable) {
|
||||
@@ -131,7 +131,7 @@ uint32 Client::NukeItem(uint32 itemnum, uint8 where_to_check) {
|
||||
}
|
||||
}
|
||||
|
||||
for (i = EQEmu::Constants::BANK_BAGS_BEGIN; i <= EQEmu::Constants::BANK_BAGS_END; i++) {
|
||||
for (i = EQEmu::constants::BANK_BAGS_BEGIN; i <= EQEmu::constants::BANK_BAGS_END; i++) {
|
||||
if (GetItemIDAt(i) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(i) != INVALID_ID)) {
|
||||
cur = m_inv.GetItem(i);
|
||||
if(cur && cur->GetItem()->Stackable) {
|
||||
@@ -146,7 +146,7 @@ uint32 Client::NukeItem(uint32 itemnum, uint8 where_to_check) {
|
||||
}
|
||||
|
||||
if(where_to_check & invWhereSharedBank) {
|
||||
for (i = EQEmu::Constants::SHARED_BANK_BEGIN; i <= EQEmu::Constants::SHARED_BANK_END; i++) {
|
||||
for (i = EQEmu::constants::SHARED_BANK_BEGIN; i <= EQEmu::constants::SHARED_BANK_END; i++) {
|
||||
if (GetItemIDAt(i) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(i) != INVALID_ID)) {
|
||||
cur = m_inv.GetItem(i);
|
||||
if(cur && cur->GetItem()->Stackable) {
|
||||
@@ -159,7 +159,7 @@ uint32 Client::NukeItem(uint32 itemnum, uint8 where_to_check) {
|
||||
}
|
||||
}
|
||||
|
||||
for (i = EQEmu::Constants::SHARED_BANK_BAGS_BEGIN; i <= EQEmu::Constants::SHARED_BANK_BAGS_END; i++) {
|
||||
for (i = EQEmu::constants::SHARED_BANK_BAGS_BEGIN; i <= EQEmu::constants::SHARED_BANK_BAGS_END; i++) {
|
||||
if (GetItemIDAt(i) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(i) != INVALID_ID)) {
|
||||
cur = m_inv.GetItem(i);
|
||||
if(cur && cur->GetItem()->Stackable) {
|
||||
@@ -236,7 +236,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
|
||||
}
|
||||
*/
|
||||
|
||||
uint32 augments[EQEmu::Constants::ITEM_COMMON_SIZE] = { aug1, aug2, aug3, aug4, aug5, aug6 };
|
||||
uint32 augments[EQEmu::constants::ITEM_COMMON_SIZE] = { aug1, aug2, aug3, aug4, aug5, aug6 };
|
||||
|
||||
uint32 classes = item->Classes;
|
||||
uint32 races = item->Races;
|
||||
@@ -246,7 +246,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
|
||||
bool enforcerestr = RuleB(Inventory, EnforceAugmentRestriction);
|
||||
bool enforceusable = RuleB(Inventory, EnforceAugmentUsability);
|
||||
|
||||
for (int iter = AUG_BEGIN; iter < EQEmu::Constants::ITEM_COMMON_SIZE; ++iter) {
|
||||
for (int iter = AUG_INDEX_BEGIN; iter < EQEmu::constants::ITEM_COMMON_SIZE; ++iter) {
|
||||
const Item_Struct* augtest = database.GetItem(augments[iter]);
|
||||
|
||||
if(augtest == nullptr) {
|
||||
@@ -540,7 +540,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
|
||||
}
|
||||
|
||||
// add any validated augments
|
||||
for (int iter = AUG_BEGIN; iter < EQEmu::Constants::ITEM_COMMON_SIZE; ++iter) {
|
||||
for (int iter = AUG_INDEX_BEGIN; iter < EQEmu::constants::ITEM_COMMON_SIZE; ++iter) {
|
||||
if(augments[iter])
|
||||
inst->PutAugment(&database, iter, augments[iter]);
|
||||
}
|
||||
@@ -583,7 +583,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
|
||||
DiscoverItem(item_id);
|
||||
/*
|
||||
// Augments should have been discovered prior to being placed on an item.
|
||||
for (int iter = AUG_BEGIN; iter < EQEmu::Constants::ITEM_COMMON_SIZE; ++iter) {
|
||||
for (int iter = AUG_BEGIN; iter < EQEmu::constants::ITEM_COMMON_SIZE; ++iter) {
|
||||
if(augments[iter] && !IsDiscovered(augments[iter]))
|
||||
DiscoverItem(augments[iter]);
|
||||
}
|
||||
@@ -761,7 +761,7 @@ void Client::DeleteItemInInventory(int16 slot_id, int8 quantity, bool client_upd
|
||||
qsaudit->items[parent_offset].aug_5 = m_inv[slot_id]->GetAugmentItemID(5);
|
||||
|
||||
if(m_inv[slot_id]->IsType(ItemClassContainer)) {
|
||||
for(uint8 bag_idx = SUB_BEGIN; bag_idx < m_inv[slot_id]->GetItem()->BagSlots; bag_idx++) {
|
||||
for (uint8 bag_idx = SUB_INDEX_BEGIN; bag_idx < m_inv[slot_id]->GetItem()->BagSlots; bag_idx++) {
|
||||
ItemInst* bagitem = m_inv[slot_id]->GetItem(bag_idx);
|
||||
|
||||
if(bagitem) {
|
||||
@@ -906,7 +906,7 @@ void Client::PutLootInInventory(int16 slot_id, const ItemInst &inst, ServerLootI
|
||||
}
|
||||
|
||||
if (bag_item_data) {
|
||||
for (int index = 0; index < EQEmu::Constants::ITEM_CONTAINER_SIZE; ++index) {
|
||||
for (int index = 0; index < EQEmu::constants::ITEM_CONTAINER_SIZE; ++index) {
|
||||
if (bag_item_data[index] == nullptr)
|
||||
continue;
|
||||
|
||||
@@ -951,7 +951,7 @@ bool Client::TryStacking(ItemInst* item, uint8 type, bool try_worn, bool try_cur
|
||||
return false;
|
||||
int16 i;
|
||||
uint32 item_id = item->GetItem()->ID;
|
||||
for (i = EQEmu::Constants::GENERAL_BEGIN; i <= EQEmu::Constants::GENERAL_END; i++) {
|
||||
for (i = EQEmu::constants::GENERAL_BEGIN; i <= EQEmu::constants::GENERAL_END; i++) {
|
||||
ItemInst* tmp_inst = m_inv.GetItem(i);
|
||||
if(tmp_inst && tmp_inst->GetItem()->ID == item_id && tmp_inst->GetCharges() < tmp_inst->GetItem()->StackSize){
|
||||
MoveItemCharges(*item, i, type);
|
||||
@@ -962,8 +962,8 @@ bool Client::TryStacking(ItemInst* item, uint8 type, bool try_worn, bool try_cur
|
||||
return true;
|
||||
}
|
||||
}
|
||||
for (i = EQEmu::Constants::GENERAL_BEGIN; i <= EQEmu::Constants::GENERAL_END; i++) {
|
||||
for (uint8 j = SUB_BEGIN; j < EQEmu::Constants::ITEM_CONTAINER_SIZE; j++) {
|
||||
for (i = EQEmu::constants::GENERAL_BEGIN; i <= EQEmu::constants::GENERAL_END; i++) {
|
||||
for (uint8 j = SUB_INDEX_BEGIN; j < EQEmu::constants::ITEM_CONTAINER_SIZE; j++) {
|
||||
uint16 slotid = Inventory::CalcSlotId(i, j);
|
||||
ItemInst* tmp_inst = m_inv.GetItem(slotid);
|
||||
|
||||
@@ -988,8 +988,8 @@ bool Client::AutoPutLootInInventory(ItemInst& inst, bool try_worn, bool try_curs
|
||||
// #1: Try to auto equip
|
||||
if (try_worn && inst.IsEquipable(GetBaseRace(), GetClass()) && inst.GetItem()->ReqLevel<=level && (!inst.GetItem()->Attuneable || inst.IsAttuned()) && inst.GetItem()->ItemType != ItemTypeAugmentation) {
|
||||
// too messy as-is... <watch>
|
||||
for (int16 i = EQEmu::Constants::EQUIPMENT_BEGIN; i < SlotPowerSource; i++) { // originally (i < 22)
|
||||
if (i == EQEmu::Constants::GENERAL_BEGIN) {
|
||||
for (int16 i = EQEmu::constants::EQUIPMENT_BEGIN; i < SlotPowerSource; i++) { // originally (i < 22)
|
||||
if (i == EQEmu::constants::GENERAL_BEGIN) {
|
||||
// added power source check for SoF+ clients
|
||||
if (this->GetClientVersion() >= ClientVersion::SoF)
|
||||
i = SlotPowerSource;
|
||||
@@ -1318,15 +1318,15 @@ void Client::SendLootItemInPacket(const ItemInst* inst, int16 slot_id)
|
||||
|
||||
bool Client::IsValidSlot(uint32 slot) {
|
||||
if ((slot == (uint32)INVALID_INDEX) ||
|
||||
(slot >= SLOT_BEGIN && slot < EQEmu::Constants::TYPE_POSSESSIONS_SIZE) ||
|
||||
(slot >= EQEmu::Constants::GENERAL_BAGS_BEGIN && slot <= EQEmu::Constants::CURSOR_BAG_END) ||
|
||||
(slot >= EQEmu::Constants::TRIBUTE_BEGIN && slot <= EQEmu::Constants::TRIBUTE_END) ||
|
||||
(slot >= EQEmu::Constants::BANK_BEGIN && slot <= EQEmu::Constants::BANK_END) ||
|
||||
(slot >= EQEmu::Constants::BANK_BAGS_BEGIN && slot <= EQEmu::Constants::BANK_BAGS_END) ||
|
||||
(slot >= EQEmu::Constants::SHARED_BANK_BEGIN && slot <= EQEmu::Constants::SHARED_BANK_END) ||
|
||||
(slot >= EQEmu::Constants::SHARED_BANK_BAGS_BEGIN && slot <= EQEmu::Constants::SHARED_BANK_BAGS_END) ||
|
||||
(slot >= EQEmu::Constants::TRADE_BEGIN && slot <= EQEmu::Constants::TRADE_END) ||
|
||||
(slot >= EQEmu::Constants::WORLD_BEGIN && slot <= EQEmu::Constants::WORLD_END) ||
|
||||
(slot >= SLOT_BEGIN && slot < EQEmu::constants::TYPE_POSSESSIONS_SIZE) ||
|
||||
(slot >= EQEmu::constants::GENERAL_BAGS_BEGIN && slot <= EQEmu::constants::CURSOR_BAG_END) ||
|
||||
(slot >= EQEmu::constants::TRIBUTE_BEGIN && slot <= EQEmu::constants::TRIBUTE_END) ||
|
||||
(slot >= EQEmu::constants::BANK_BEGIN && slot <= EQEmu::constants::BANK_END) ||
|
||||
(slot >= EQEmu::constants::BANK_BAGS_BEGIN && slot <= EQEmu::constants::BANK_BAGS_END) ||
|
||||
(slot >= EQEmu::constants::SHARED_BANK_BEGIN && slot <= EQEmu::constants::SHARED_BANK_END) ||
|
||||
(slot >= EQEmu::constants::SHARED_BANK_BAGS_BEGIN && slot <= EQEmu::constants::SHARED_BANK_BAGS_END) ||
|
||||
(slot >= EQEmu::constants::TRADE_BEGIN && slot <= EQEmu::constants::TRADE_END) ||
|
||||
(slot >= EQEmu::constants::WORLD_BEGIN && slot <= EQEmu::constants::WORLD_END) ||
|
||||
(slot == SlotPowerSource)
|
||||
) {
|
||||
return true;
|
||||
@@ -1338,10 +1338,10 @@ bool Client::IsValidSlot(uint32 slot) {
|
||||
|
||||
bool Client::IsBankSlot(uint32 slot)
|
||||
{
|
||||
if ((slot >= EQEmu::Constants::BANK_BEGIN && slot <= EQEmu::Constants::BANK_END) ||
|
||||
(slot >= EQEmu::Constants::BANK_BAGS_BEGIN && slot <= EQEmu::Constants::BANK_BAGS_END) ||
|
||||
(slot >= EQEmu::Constants::SHARED_BANK_BEGIN && slot <= EQEmu::Constants::SHARED_BANK_END) ||
|
||||
(slot >= EQEmu::Constants::SHARED_BANK_BAGS_BEGIN && slot <= EQEmu::Constants::SHARED_BANK_BAGS_END))
|
||||
if ((slot >= EQEmu::constants::BANK_BEGIN && slot <= EQEmu::constants::BANK_END) ||
|
||||
(slot >= EQEmu::constants::BANK_BAGS_BEGIN && slot <= EQEmu::constants::BANK_BAGS_END) ||
|
||||
(slot >= EQEmu::constants::SHARED_BANK_BEGIN && slot <= EQEmu::constants::SHARED_BANK_END) ||
|
||||
(slot >= EQEmu::constants::SHARED_BANK_BAGS_BEGIN && slot <= EQEmu::constants::SHARED_BANK_BAGS_END))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -1475,13 +1475,13 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
|
||||
uint32 dstbagid = 0;
|
||||
|
||||
//if (src_slot_id >= 250 && src_slot_id < 330) {
|
||||
if (src_slot_id >= EQEmu::Constants::GENERAL_BAGS_BEGIN && src_slot_id <= EQEmu::Constants::GENERAL_BAGS_END) {
|
||||
if (src_slot_id >= EQEmu::constants::GENERAL_BAGS_BEGIN && src_slot_id <= EQEmu::constants::GENERAL_BAGS_END) {
|
||||
srcbag = m_inv.GetItem(((int)(src_slot_id / 10)) - 3);
|
||||
if (srcbag)
|
||||
srcbagid = srcbag->GetItem()->ID;
|
||||
}
|
||||
//if (dst_slot_id >= 250 && dst_slot_id < 330) {
|
||||
if (dst_slot_id >= EQEmu::Constants::GENERAL_BAGS_BEGIN && dst_slot_id <= EQEmu::Constants::GENERAL_BAGS_END) {
|
||||
if (dst_slot_id >= EQEmu::constants::GENERAL_BAGS_BEGIN && dst_slot_id <= EQEmu::constants::GENERAL_BAGS_END) {
|
||||
dstbag = m_inv.GetItem(((int)(dst_slot_id / 10)) - 3);
|
||||
if (dstbag)
|
||||
dstbagid = dstbag->GetItem()->ID;
|
||||
@@ -1494,7 +1494,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
|
||||
|
||||
// Step 2: Validate item in from_slot
|
||||
// After this, we can assume src_inst is a valid ptr
|
||||
if (!src_inst && (src_slot_id < EQEmu::Constants::WORLD_BEGIN || src_slot_id > EQEmu::Constants::WORLD_END)) {
|
||||
if (!src_inst && (src_slot_id < EQEmu::constants::WORLD_BEGIN || src_slot_id > EQEmu::constants::WORLD_END)) {
|
||||
if (dst_inst) {
|
||||
// If there is no source item, but there is a destination item,
|
||||
// move the slots around before deleting the invalid source slot item,
|
||||
@@ -1508,14 +1508,14 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
|
||||
return false;
|
||||
}
|
||||
//verify shared bank transactions in the database
|
||||
if(src_inst && src_slot_id >= EQEmu::Constants::SHARED_BANK_BEGIN && src_slot_id <= EQEmu::Constants::SHARED_BANK_BAGS_END) {
|
||||
if(src_inst && src_slot_id >= EQEmu::constants::SHARED_BANK_BEGIN && src_slot_id <= EQEmu::constants::SHARED_BANK_BAGS_END) {
|
||||
if(!database.VerifyInventory(account_id, src_slot_id, src_inst)) {
|
||||
Log.Out(Logs::General, Logs::Error, "Player %s on account %s was found exploiting the shared bank.\n", GetName(), account_name);
|
||||
DeleteItemInInventory(dst_slot_id,0,true);
|
||||
return(false);
|
||||
}
|
||||
if(src_slot_id >= EQEmu::Constants::SHARED_BANK_BEGIN && src_slot_id <= EQEmu::Constants::SHARED_BANK_END && src_inst->IsType(ItemClassContainer)){
|
||||
for (uint8 idx = SUB_BEGIN; idx < EQEmu::Constants::ITEM_CONTAINER_SIZE; idx++) {
|
||||
if(src_slot_id >= EQEmu::constants::SHARED_BANK_BEGIN && src_slot_id <= EQEmu::constants::SHARED_BANK_END && src_inst->IsType(ItemClassContainer)){
|
||||
for (uint8 idx = SUB_INDEX_BEGIN; idx < EQEmu::constants::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);
|
||||
@@ -1523,14 +1523,14 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
|
||||
}
|
||||
}
|
||||
}
|
||||
if(dst_inst && dst_slot_id >= EQEmu::Constants::SHARED_BANK_BEGIN && dst_slot_id <= EQEmu::Constants::SHARED_BANK_BAGS_END) {
|
||||
if(dst_inst && dst_slot_id >= EQEmu::constants::SHARED_BANK_BEGIN && dst_slot_id <= EQEmu::constants::SHARED_BANK_BAGS_END) {
|
||||
if(!database.VerifyInventory(account_id, dst_slot_id, dst_inst)) {
|
||||
Log.Out(Logs::General, Logs::Error, "Player %s on account %s was found exploting the shared bank.\n", GetName(), account_name);
|
||||
DeleteItemInInventory(src_slot_id,0,true);
|
||||
return(false);
|
||||
}
|
||||
if(dst_slot_id >= EQEmu::Constants::SHARED_BANK_BEGIN && dst_slot_id <= EQEmu::Constants::SHARED_BANK_END && dst_inst->IsType(ItemClassContainer)){
|
||||
for (uint8 idx = SUB_BEGIN; idx < EQEmu::Constants::ITEM_CONTAINER_SIZE; idx++) {
|
||||
if(dst_slot_id >= EQEmu::constants::SHARED_BANK_BEGIN && dst_slot_id <= EQEmu::constants::SHARED_BANK_END && dst_inst->IsType(ItemClassContainer)){
|
||||
for (uint8 idx = SUB_INDEX_BEGIN; idx < EQEmu::constants::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);
|
||||
@@ -1542,8 +1542,8 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
|
||||
|
||||
// Check for No Drop Hacks
|
||||
Mob* with = trade->With();
|
||||
if (((with && with->IsClient() && dst_slot_id >= EQEmu::Constants::TRADE_BEGIN && dst_slot_id <= EQEmu::Constants::TRADE_END) ||
|
||||
(dst_slot_id >= EQEmu::Constants::SHARED_BANK_BEGIN && dst_slot_id <= EQEmu::Constants::SHARED_BANK_BAGS_END))
|
||||
if (((with && with->IsClient() && dst_slot_id >= EQEmu::constants::TRADE_BEGIN && dst_slot_id <= EQEmu::constants::TRADE_END) ||
|
||||
(dst_slot_id >= EQEmu::constants::SHARED_BANK_BEGIN && dst_slot_id <= EQEmu::constants::SHARED_BANK_BAGS_END))
|
||||
&& GetInv().CheckNoDrop(src_slot_id)
|
||||
&& RuleI(World, FVNoDropFlag) == 0 || RuleI(Character, MinStatusForNoDropExemptions) < Admin() && RuleI(World, FVNoDropFlag) == 2) {
|
||||
auto ndh_inst = m_inv[src_slot_id];
|
||||
@@ -1573,7 +1573,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
|
||||
|
||||
// Step 3: Check for interaction with World Container (tradeskills)
|
||||
if(m_tradeskill_object != nullptr) {
|
||||
if (src_slot_id >= EQEmu::Constants::WORLD_BEGIN && src_slot_id <= EQEmu::Constants::WORLD_END) {
|
||||
if (src_slot_id >= EQEmu::constants::WORLD_BEGIN && src_slot_id <= EQEmu::constants::WORLD_END) {
|
||||
// Picking up item from world container
|
||||
ItemInst* inst = m_tradeskill_object->PopItem(Inventory::CalcBagIdx(src_slot_id));
|
||||
if (inst) {
|
||||
@@ -1585,7 +1585,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (dst_slot_id >= EQEmu::Constants::WORLD_BEGIN && dst_slot_id <= EQEmu::Constants::WORLD_END) {
|
||||
else if (dst_slot_id >= EQEmu::constants::WORLD_BEGIN && dst_slot_id <= EQEmu::constants::WORLD_END) {
|
||||
// Putting item into world container, which may swap (or pile onto) with existing item
|
||||
uint8 world_idx = Inventory::CalcBagIdx(dst_slot_id);
|
||||
ItemInst* world_inst = m_tradeskill_object->PopItem(world_idx);
|
||||
@@ -1658,7 +1658,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
|
||||
}
|
||||
|
||||
// Step 4: Check for entity trade
|
||||
if (dst_slot_id >= EQEmu::Constants::TRADE_BEGIN && dst_slot_id <= EQEmu::Constants::TRADE_END) {
|
||||
if (dst_slot_id >= EQEmu::constants::TRADE_BEGIN && dst_slot_id <= EQEmu::constants::TRADE_END) {
|
||||
if (src_slot_id != SlotCursor) {
|
||||
Kick();
|
||||
return false;
|
||||
@@ -1751,12 +1751,12 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
|
||||
}
|
||||
else {
|
||||
// Not dealing with charges - just do direct swap
|
||||
if(src_inst && (dst_slot_id <= EQEmu::Constants::EQUIPMENT_END || dst_slot_id == SlotPowerSource) && dst_slot_id >= EQEmu::Constants::EQUIPMENT_BEGIN) {
|
||||
if(src_inst && (dst_slot_id <= EQEmu::constants::EQUIPMENT_END || dst_slot_id == SlotPowerSource) && dst_slot_id >= EQEmu::constants::EQUIPMENT_BEGIN) {
|
||||
if (src_inst->GetItem()->Attuneable) {
|
||||
src_inst->SetAttuned(true);
|
||||
}
|
||||
if (src_inst->IsAugmented()) {
|
||||
for (int i = AUG_BEGIN; i < EQEmu::Constants::ITEM_COMMON_SIZE; i++) {
|
||||
for (int i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; i++) {
|
||||
if (src_inst->GetAugment(i)) {
|
||||
if (src_inst->GetAugment(i)->GetItem()->Attuneable) {
|
||||
src_inst->GetAugment(i)->SetAttuned(true);
|
||||
@@ -1769,7 +1769,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
|
||||
if(!m_inv.SwapItem(src_slot_id, dst_slot_id)) { return false; }
|
||||
Log.Out(Logs::Detail, Logs::Inventory, "Moving entire item from slot %d to slot %d", src_slot_id, dst_slot_id);
|
||||
|
||||
if(src_slot_id <= EQEmu::Constants::EQUIPMENT_END || src_slot_id == SlotPowerSource) {
|
||||
if(src_slot_id <= EQEmu::constants::EQUIPMENT_END || src_slot_id == SlotPowerSource) {
|
||||
if(src_inst) {
|
||||
parse->EventItem(EVENT_UNEQUIP_ITEM, this, src_inst, nullptr, "", src_slot_id);
|
||||
}
|
||||
@@ -1779,7 +1779,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
|
||||
}
|
||||
}
|
||||
|
||||
if(dst_slot_id <= EQEmu::Constants::EQUIPMENT_END || dst_slot_id == SlotPowerSource) {
|
||||
if(dst_slot_id <= EQEmu::constants::EQUIPMENT_END || dst_slot_id == SlotPowerSource) {
|
||||
if(dst_inst) {
|
||||
parse->EventItem(EVENT_UNEQUIP_ITEM, this, dst_inst, nullptr, "", dst_slot_id);
|
||||
}
|
||||
@@ -1791,7 +1791,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
|
||||
}
|
||||
|
||||
int matslot = SlotConvert2(dst_slot_id);
|
||||
if (dst_slot_id <= EQEmu::Constants::EQUIPMENT_END && matslot != MaterialHead) { // think this is to allow the client to update with /showhelm
|
||||
if (dst_slot_id <= EQEmu::constants::EQUIPMENT_END && matslot != MaterialHead) { // think this is to allow the client to update with /showhelm
|
||||
SendWearChange(matslot);
|
||||
}
|
||||
|
||||
@@ -1833,7 +1833,7 @@ void Client::SwapItemResync(MoveItem_Struct* move_slots) {
|
||||
Log.Out(Logs::Detail, Logs::Inventory, "Inventory desyncronization. (charname: %s, source: %i, destination: %i)", GetName(), move_slots->from_slot, move_slots->to_slot);
|
||||
Message(15, "Inventory Desyncronization detected: Resending slot data...");
|
||||
|
||||
if((move_slots->from_slot >= EQEmu::Constants::EQUIPMENT_BEGIN && move_slots->from_slot <= EQEmu::Constants::CURSOR_BAG_END) || move_slots->from_slot == SlotPowerSource) {
|
||||
if((move_slots->from_slot >= EQEmu::constants::EQUIPMENT_BEGIN && move_slots->from_slot <= EQEmu::constants::CURSOR_BAG_END) || move_slots->from_slot == SlotPowerSource) {
|
||||
int16 resync_slot = (Inventory::CalcSlotId(move_slots->from_slot) == INVALID_INDEX) ? move_slots->from_slot : Inventory::CalcSlotId(move_slots->from_slot);
|
||||
if (IsValidSlot(resync_slot) && resync_slot != INVALID_INDEX) {
|
||||
// This prevents the client from crashing when closing any 'phantom' bags
|
||||
@@ -1876,7 +1876,7 @@ void Client::SwapItemResync(MoveItem_Struct* move_slots) {
|
||||
else { Message(13, "Could not resyncronize source slot %i.", move_slots->from_slot); }
|
||||
}
|
||||
|
||||
if((move_slots->to_slot >= EQEmu::Constants::EQUIPMENT_BEGIN && move_slots->to_slot <= EQEmu::Constants::CURSOR_BAG_END) || move_slots->to_slot == SlotPowerSource) {
|
||||
if((move_slots->to_slot >= EQEmu::constants::EQUIPMENT_BEGIN && move_slots->to_slot <= EQEmu::constants::CURSOR_BAG_END) || move_slots->to_slot == SlotPowerSource) {
|
||||
int16 resync_slot = (Inventory::CalcSlotId(move_slots->to_slot) == INVALID_INDEX) ? move_slots->to_slot : Inventory::CalcSlotId(move_slots->to_slot);
|
||||
if (IsValidSlot(resync_slot) && resync_slot != INVALID_INDEX) {
|
||||
const Item_Struct* token_struct = database.GetItem(22292); // 'Copper Coin'
|
||||
@@ -1957,7 +1957,7 @@ void Client::QSSwapItemAuditor(MoveItem_Struct* move_in, bool postaction_call) {
|
||||
qsaudit->items[move_count++].aug_5 = from_inst->GetAugmentItemID(5);
|
||||
|
||||
if(from_inst->IsType(ItemClassContainer)) {
|
||||
for(uint8 bag_idx = SUB_BEGIN; bag_idx < from_inst->GetItem()->BagSlots; bag_idx++) {
|
||||
for (uint8 bag_idx = SUB_INDEX_BEGIN; bag_idx < from_inst->GetItem()->BagSlots; bag_idx++) {
|
||||
const ItemInst* from_baginst = from_inst->GetItem(bag_idx);
|
||||
|
||||
if(from_baginst) {
|
||||
@@ -1990,7 +1990,7 @@ void Client::QSSwapItemAuditor(MoveItem_Struct* move_in, bool postaction_call) {
|
||||
qsaudit->items[move_count++].aug_5 = to_inst->GetAugmentItemID(5);
|
||||
|
||||
if(to_inst->IsType(ItemClassContainer)) {
|
||||
for(uint8 bag_idx = SUB_BEGIN; bag_idx < to_inst->GetItem()->BagSlots; bag_idx++) {
|
||||
for (uint8 bag_idx = SUB_INDEX_BEGIN; bag_idx < to_inst->GetItem()->BagSlots; bag_idx++) {
|
||||
const ItemInst* to_baginst = to_inst->GetItem(bag_idx);
|
||||
|
||||
if(to_baginst) {
|
||||
@@ -2019,7 +2019,7 @@ void Client::QSSwapItemAuditor(MoveItem_Struct* move_in, bool postaction_call) {
|
||||
|
||||
void Client::DyeArmor(DyeStruct* dye){
|
||||
int16 slot=0;
|
||||
for (int i = EQEmu::Constants::MATERIAL_BEGIN; i <= EQEmu::Constants::MATERIAL_TINT_END; i++) {
|
||||
for (int i = EQEmu::constants::MATERIAL_BEGIN; i <= EQEmu::constants::MATERIAL_TINT_END; i++) {
|
||||
if ((m_pp.item_tint[i].Color & 0x00FFFFFF) != (dye->dye[i].Color & 0x00FFFFFF)) {
|
||||
slot = m_inv.HasItem(32557, 1, invWherePersonal);
|
||||
if (slot != INVALID_INDEX){
|
||||
@@ -2058,7 +2058,7 @@ bool Client::DecreaseByItemType(uint32 type, uint8 amt) {
|
||||
const Item_Struct* TempItem = 0;
|
||||
ItemInst* ins;
|
||||
int x;
|
||||
for(x=EQEmu::Constants::POSSESSIONS_BEGIN; x <= EQEmu::Constants::POSSESSIONS_END; x++)
|
||||
for(x=EQEmu::constants::POSSESSIONS_BEGIN; x <= EQEmu::constants::POSSESSIONS_END; x++)
|
||||
{
|
||||
TempItem = 0;
|
||||
ins = GetInv().GetItem(x);
|
||||
@@ -2080,7 +2080,7 @@ bool Client::DecreaseByItemType(uint32 type, uint8 amt) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
for(x=EQEmu::Constants::GENERAL_BAGS_BEGIN; x <= EQEmu::Constants::GENERAL_BAGS_END; x++)
|
||||
for(x=EQEmu::constants::GENERAL_BAGS_BEGIN; x <= EQEmu::constants::GENERAL_BAGS_END; x++)
|
||||
{
|
||||
TempItem = 0;
|
||||
ins = GetInv().GetItem(x);
|
||||
@@ -2111,10 +2111,10 @@ bool Client::DecreaseByID(uint32 type, uint8 amt) {
|
||||
ItemInst* ins = nullptr;
|
||||
int x;
|
||||
int num = 0;
|
||||
for(x = EQEmu::Constants::EQUIPMENT_BEGIN; x <= EQEmu::Constants::GENERAL_BAGS_END; x++)
|
||||
for(x = EQEmu::constants::EQUIPMENT_BEGIN; x <= EQEmu::constants::GENERAL_BAGS_END; x++)
|
||||
{
|
||||
if (x == SlotCursor + 1)
|
||||
x = EQEmu::Constants::GENERAL_BAGS_BEGIN;
|
||||
x = EQEmu::constants::GENERAL_BAGS_BEGIN;
|
||||
TempItem = nullptr;
|
||||
ins = GetInv().GetItem(x);
|
||||
if (ins)
|
||||
@@ -2128,10 +2128,10 @@ bool Client::DecreaseByID(uint32 type, uint8 amt) {
|
||||
}
|
||||
if (num < amt)
|
||||
return false;
|
||||
for(x = EQEmu::Constants::EQUIPMENT_BEGIN; x <= EQEmu::Constants::GENERAL_BAGS_END; x++) // should this be CURSOR_BAG_END?
|
||||
for(x = EQEmu::constants::EQUIPMENT_BEGIN; x <= EQEmu::constants::GENERAL_BAGS_END; x++) // should this be CURSOR_BAG_END?
|
||||
{
|
||||
if (x == SlotCursor + 1)
|
||||
x = EQEmu::Constants::GENERAL_BAGS_BEGIN;
|
||||
x = EQEmu::constants::GENERAL_BAGS_BEGIN;
|
||||
TempItem = nullptr;
|
||||
ins = GetInv().GetItem(x);
|
||||
if (ins)
|
||||
@@ -2227,7 +2227,7 @@ static bool CopyBagContents(ItemInst* new_bag, const ItemInst* old_bag)
|
||||
|
||||
void Client::DisenchantSummonedBags(bool client_update)
|
||||
{
|
||||
for (auto slot_id = EQEmu::Constants::GENERAL_BEGIN; slot_id <= EQEmu::Constants::GENERAL_END; ++slot_id) {
|
||||
for (auto slot_id = EQEmu::constants::GENERAL_BEGIN; slot_id <= EQEmu::constants::GENERAL_END; ++slot_id) {
|
||||
auto inst = m_inv[slot_id];
|
||||
if (!inst) { continue; }
|
||||
if (!IsSummonedBagID(inst->GetItem()->ID)) { continue; }
|
||||
@@ -2248,7 +2248,7 @@ void Client::DisenchantSummonedBags(bool client_update)
|
||||
safe_delete(new_inst);
|
||||
}
|
||||
|
||||
for (auto slot_id = EQEmu::Constants::BANK_BEGIN; slot_id <= EQEmu::Constants::BANK_END; ++slot_id) {
|
||||
for (auto slot_id = EQEmu::constants::BANK_BEGIN; slot_id <= EQEmu::constants::BANK_END; ++slot_id) {
|
||||
auto inst = m_inv[slot_id];
|
||||
if (!inst) { continue; }
|
||||
if (!IsSummonedBagID(inst->GetItem()->ID)) { continue; }
|
||||
@@ -2269,7 +2269,7 @@ void Client::DisenchantSummonedBags(bool client_update)
|
||||
safe_delete(new_inst);
|
||||
}
|
||||
|
||||
for (auto slot_id = EQEmu::Constants::SHARED_BANK_BEGIN; slot_id <= EQEmu::Constants::SHARED_BANK_END; ++slot_id) {
|
||||
for (auto slot_id = EQEmu::constants::SHARED_BANK_BEGIN; slot_id <= EQEmu::constants::SHARED_BANK_END; ++slot_id) {
|
||||
auto inst = m_inv[slot_id];
|
||||
if (!inst) { continue; }
|
||||
if (!IsSummonedBagID(inst->GetItem()->ID)) { continue; }
|
||||
@@ -2338,7 +2338,7 @@ void Client::DisenchantSummonedBags(bool client_update)
|
||||
|
||||
void Client::RemoveNoRent(bool client_update)
|
||||
{
|
||||
for (auto slot_id = EQEmu::Constants::EQUIPMENT_BEGIN; slot_id <= EQEmu::Constants::EQUIPMENT_END; ++slot_id) {
|
||||
for (auto slot_id = EQEmu::constants::EQUIPMENT_BEGIN; slot_id <= EQEmu::constants::EQUIPMENT_END; ++slot_id) {
|
||||
auto inst = m_inv[slot_id];
|
||||
if(inst && !inst->GetItem()->NoRent) {
|
||||
Log.Out(Logs::Detail, Logs::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
|
||||
@@ -2346,7 +2346,7 @@ void Client::RemoveNoRent(bool client_update)
|
||||
}
|
||||
}
|
||||
|
||||
for (auto slot_id = EQEmu::Constants::GENERAL_BEGIN; slot_id <= EQEmu::Constants::GENERAL_END; ++slot_id) {
|
||||
for (auto slot_id = EQEmu::constants::GENERAL_BEGIN; slot_id <= EQEmu::constants::GENERAL_END; ++slot_id) {
|
||||
auto inst = m_inv[slot_id];
|
||||
if (inst && !inst->GetItem()->NoRent) {
|
||||
Log.Out(Logs::Detail, Logs::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
|
||||
@@ -2362,7 +2362,7 @@ void Client::RemoveNoRent(bool client_update)
|
||||
}
|
||||
}
|
||||
|
||||
for (auto slot_id = EQEmu::Constants::GENERAL_BAGS_BEGIN; slot_id <= EQEmu::Constants::CURSOR_BAG_END; ++slot_id) {
|
||||
for (auto slot_id = EQEmu::constants::GENERAL_BAGS_BEGIN; slot_id <= EQEmu::constants::CURSOR_BAG_END; ++slot_id) {
|
||||
auto inst = m_inv[slot_id];
|
||||
if(inst && !inst->GetItem()->NoRent) {
|
||||
Log.Out(Logs::Detail, Logs::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
|
||||
@@ -2370,7 +2370,7 @@ void Client::RemoveNoRent(bool client_update)
|
||||
}
|
||||
}
|
||||
|
||||
for (auto slot_id = EQEmu::Constants::BANK_BEGIN; slot_id <= EQEmu::Constants::BANK_END; ++slot_id) {
|
||||
for (auto slot_id = EQEmu::constants::BANK_BEGIN; slot_id <= EQEmu::constants::BANK_END; ++slot_id) {
|
||||
auto inst = m_inv[slot_id];
|
||||
if(inst && !inst->GetItem()->NoRent) {
|
||||
Log.Out(Logs::Detail, Logs::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
|
||||
@@ -2378,7 +2378,7 @@ void Client::RemoveNoRent(bool client_update)
|
||||
}
|
||||
}
|
||||
|
||||
for (auto slot_id = EQEmu::Constants::BANK_BAGS_BEGIN; slot_id <= EQEmu::Constants::BANK_BAGS_END; ++slot_id) {
|
||||
for (auto slot_id = EQEmu::constants::BANK_BAGS_BEGIN; slot_id <= EQEmu::constants::BANK_BAGS_END; ++slot_id) {
|
||||
auto inst = m_inv[slot_id];
|
||||
if(inst && !inst->GetItem()->NoRent) {
|
||||
Log.Out(Logs::Detail, Logs::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
|
||||
@@ -2386,7 +2386,7 @@ void Client::RemoveNoRent(bool client_update)
|
||||
}
|
||||
}
|
||||
|
||||
for (auto slot_id = EQEmu::Constants::SHARED_BANK_BEGIN; slot_id <= EQEmu::Constants::SHARED_BANK_END; ++slot_id) {
|
||||
for (auto slot_id = EQEmu::constants::SHARED_BANK_BEGIN; slot_id <= EQEmu::constants::SHARED_BANK_END; ++slot_id) {
|
||||
auto inst = m_inv[slot_id];
|
||||
if(inst && !inst->GetItem()->NoRent) {
|
||||
Log.Out(Logs::Detail, Logs::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
|
||||
@@ -2394,7 +2394,7 @@ void Client::RemoveNoRent(bool client_update)
|
||||
}
|
||||
}
|
||||
|
||||
for (auto slot_id = EQEmu::Constants::SHARED_BANK_BAGS_BEGIN; slot_id <= EQEmu::Constants::SHARED_BANK_BAGS_END; ++slot_id) {
|
||||
for (auto slot_id = EQEmu::constants::SHARED_BANK_BAGS_BEGIN; slot_id <= EQEmu::constants::SHARED_BANK_BAGS_END; ++slot_id) {
|
||||
auto inst = m_inv[slot_id];
|
||||
if(inst && !inst->GetItem()->NoRent) {
|
||||
Log.Out(Logs::Detail, Logs::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
|
||||
@@ -2432,7 +2432,7 @@ void Client::RemoveNoRent(bool client_update)
|
||||
// Two new methods to alleviate perpetual login desyncs
|
||||
void Client::RemoveDuplicateLore(bool client_update)
|
||||
{
|
||||
for (auto slot_id = EQEmu::Constants::EQUIPMENT_BEGIN; slot_id <= EQEmu::Constants::EQUIPMENT_END; ++slot_id) {
|
||||
for (auto slot_id = EQEmu::constants::EQUIPMENT_BEGIN; slot_id <= EQEmu::constants::EQUIPMENT_END; ++slot_id) {
|
||||
auto inst = m_inv.PopItem(slot_id);
|
||||
if (inst == nullptr) { continue; }
|
||||
if(CheckLoreConflict(inst->GetItem())) {
|
||||
@@ -2445,7 +2445,7 @@ void Client::RemoveDuplicateLore(bool client_update)
|
||||
safe_delete(inst);
|
||||
}
|
||||
|
||||
for (auto slot_id = EQEmu::Constants::GENERAL_BEGIN; slot_id <= EQEmu::Constants::GENERAL_END; ++slot_id) {
|
||||
for (auto slot_id = EQEmu::constants::GENERAL_BEGIN; slot_id <= EQEmu::constants::GENERAL_END; ++slot_id) {
|
||||
auto inst = m_inv.PopItem(slot_id);
|
||||
if (inst == nullptr) { continue; }
|
||||
if (CheckLoreConflict(inst->GetItem())) {
|
||||
@@ -2472,7 +2472,7 @@ void Client::RemoveDuplicateLore(bool client_update)
|
||||
}
|
||||
}
|
||||
|
||||
for (auto slot_id = EQEmu::Constants::GENERAL_BAGS_BEGIN; slot_id <= EQEmu::Constants::CURSOR_BAG_END; ++slot_id) {
|
||||
for (auto slot_id = EQEmu::constants::GENERAL_BAGS_BEGIN; slot_id <= EQEmu::constants::CURSOR_BAG_END; ++slot_id) {
|
||||
auto inst = m_inv.PopItem(slot_id);
|
||||
if (inst == nullptr) { continue; }
|
||||
if(CheckLoreConflict(inst->GetItem())) {
|
||||
@@ -2485,7 +2485,7 @@ void Client::RemoveDuplicateLore(bool client_update)
|
||||
safe_delete(inst);
|
||||
}
|
||||
|
||||
for (auto slot_id = EQEmu::Constants::BANK_BEGIN; slot_id <= EQEmu::Constants::BANK_END; ++slot_id) {
|
||||
for (auto slot_id = EQEmu::constants::BANK_BEGIN; slot_id <= EQEmu::constants::BANK_END; ++slot_id) {
|
||||
auto inst = m_inv.PopItem(slot_id);
|
||||
if (inst == nullptr) { continue; }
|
||||
if(CheckLoreConflict(inst->GetItem())) {
|
||||
@@ -2498,7 +2498,7 @@ void Client::RemoveDuplicateLore(bool client_update)
|
||||
safe_delete(inst);
|
||||
}
|
||||
|
||||
for (auto slot_id = EQEmu::Constants::BANK_BAGS_BEGIN; slot_id <= EQEmu::Constants::BANK_BAGS_END; ++slot_id) {
|
||||
for (auto slot_id = EQEmu::constants::BANK_BAGS_BEGIN; slot_id <= EQEmu::constants::BANK_BAGS_END; ++slot_id) {
|
||||
auto inst = m_inv.PopItem(slot_id);
|
||||
if (inst == nullptr) { continue; }
|
||||
if(CheckLoreConflict(inst->GetItem())) {
|
||||
@@ -2559,7 +2559,7 @@ void Client::RemoveDuplicateLore(bool client_update)
|
||||
|
||||
void Client::MoveSlotNotAllowed(bool client_update)
|
||||
{
|
||||
for (auto slot_id = EQEmu::Constants::EQUIPMENT_BEGIN; slot_id <= EQEmu::Constants::EQUIPMENT_END; ++slot_id) {
|
||||
for (auto slot_id = EQEmu::constants::EQUIPMENT_BEGIN; slot_id <= EQEmu::constants::EQUIPMENT_END; ++slot_id) {
|
||||
if(m_inv[slot_id] && !m_inv[slot_id]->IsSlotAllowed(slot_id)) {
|
||||
auto inst = m_inv.PopItem(slot_id);
|
||||
bool is_arrow = (inst->GetItem()->ItemType == ItemTypeArrow) ? true : false;
|
||||
@@ -2591,7 +2591,7 @@ uint32 Client::GetEquipment(uint8 material_slot) const
|
||||
int16 invslot;
|
||||
const ItemInst *item;
|
||||
|
||||
if(material_slot > EQEmu::Constants::MATERIAL_END)
|
||||
if(material_slot > EQEmu::constants::MATERIAL_END)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -2629,7 +2629,7 @@ int32 Client::GetEquipmentMaterial(uint8 material_slot)
|
||||
|
||||
uint32 Client::GetEquipmentColor(uint8 material_slot) const
|
||||
{
|
||||
if (material_slot > EQEmu::Constants::MATERIAL_END)
|
||||
if (material_slot > EQEmu::constants::MATERIAL_END)
|
||||
return 0;
|
||||
|
||||
const Item_Struct *item = database.GetItem(GetEquipment(material_slot));
|
||||
@@ -2780,7 +2780,7 @@ void Client::SetBandolier(const EQApplicationPacket *app)
|
||||
slot = SlotCursor;
|
||||
}
|
||||
else if (m_inv.GetItem(SlotCursor)->GetItem()->ItemClass == 1) {
|
||||
for(int16 CursorBagSlot = EQEmu::Constants::CURSOR_BAG_BEGIN; CursorBagSlot <= EQEmu::Constants::CURSOR_BAG_END; CursorBagSlot++) {
|
||||
for(int16 CursorBagSlot = EQEmu::constants::CURSOR_BAG_BEGIN; CursorBagSlot <= EQEmu::constants::CURSOR_BAG_END; CursorBagSlot++) {
|
||||
if (m_inv.GetItem(CursorBagSlot)) {
|
||||
if (m_inv.GetItem(CursorBagSlot)->GetItem()->ID == m_pp.bandoliers[bss->Number].Items[BandolierSlot].ID &&
|
||||
m_inv.GetItem(CursorBagSlot)->GetCharges() >= 1) { // ditto
|
||||
@@ -2926,7 +2926,7 @@ bool Client::MoveItemToInventory(ItemInst *ItemToReturn, bool UpdateClient) {
|
||||
//
|
||||
if(ItemToReturn->IsStackable()) {
|
||||
|
||||
for (int16 i = EQEmu::Constants::GENERAL_BEGIN; i <= SlotCursor; i++) { // changed slot max to 30 from 29. client will stack into slot 30 (bags too) before moving.
|
||||
for (int16 i = EQEmu::constants::GENERAL_BEGIN; i <= SlotCursor; i++) { // changed slot max to 30 from 29. client will stack into slot 30 (bags too) before moving.
|
||||
|
||||
ItemInst* InvItem = m_inv.GetItem(i);
|
||||
|
||||
@@ -2952,12 +2952,12 @@ bool Client::MoveItemToInventory(ItemInst *ItemToReturn, bool UpdateClient) {
|
||||
//
|
||||
if (InvItem && InvItem->IsType(ItemClassContainer)) {
|
||||
|
||||
int16 BaseSlotID = Inventory::CalcSlotId(i, SUB_BEGIN);
|
||||
int16 BaseSlotID = Inventory::CalcSlotId(i, SUB_INDEX_BEGIN);
|
||||
|
||||
uint8 BagSize=InvItem->GetItem()->BagSlots;
|
||||
|
||||
uint8 BagSlot;
|
||||
for (BagSlot = SUB_BEGIN; BagSlot < BagSize; BagSlot++) {
|
||||
for (BagSlot = SUB_INDEX_BEGIN; BagSlot < BagSize; BagSlot++) {
|
||||
InvItem = m_inv.GetItem(BaseSlotID + BagSlot);
|
||||
if (InvItem && (InvItem->GetItem()->ID == ItemID) &&
|
||||
(InvItem->GetCharges() < InvItem->GetItem()->StackSize)) {
|
||||
@@ -2985,7 +2985,7 @@ bool Client::MoveItemToInventory(ItemInst *ItemToReturn, bool UpdateClient) {
|
||||
|
||||
// We have tried stacking items, now just try and find an empty slot.
|
||||
|
||||
for (int16 i = EQEmu::Constants::GENERAL_BEGIN; i <= SlotCursor; i++) { // changed slot max to 30 from 29. client will move into slot 30 (bags too) before pushing onto cursor.
|
||||
for (int16 i = EQEmu::constants::GENERAL_BEGIN; i <= SlotCursor; i++) { // changed slot max to 30 from 29. client will move into slot 30 (bags too) before pushing onto cursor.
|
||||
|
||||
ItemInst* InvItem = m_inv.GetItem(i);
|
||||
|
||||
@@ -3004,11 +3004,11 @@ bool Client::MoveItemToInventory(ItemInst *ItemToReturn, bool UpdateClient) {
|
||||
}
|
||||
if(InvItem->IsType(ItemClassContainer) && Inventory::CanItemFitInContainer(ItemToReturn->GetItem(), InvItem->GetItem())) {
|
||||
|
||||
int16 BaseSlotID = Inventory::CalcSlotId(i, SUB_BEGIN);
|
||||
int16 BaseSlotID = Inventory::CalcSlotId(i, SUB_INDEX_BEGIN);
|
||||
|
||||
uint8 BagSize=InvItem->GetItem()->BagSlots;
|
||||
|
||||
for (uint8 BagSlot = SUB_BEGIN; BagSlot < BagSize; BagSlot++) {
|
||||
for (uint8 BagSlot = SUB_INDEX_BEGIN; BagSlot < BagSize; BagSlot++) {
|
||||
|
||||
InvItem = m_inv.GetItem(BaseSlotID + BagSlot);
|
||||
|
||||
@@ -3046,27 +3046,27 @@ bool Client::InterrogateInventory(Client* requester, bool log, bool silent, bool
|
||||
std::map<int16, const ItemInst*> instmap;
|
||||
|
||||
// build reference map
|
||||
for (int16 index = SLOT_BEGIN; index < EQEmu::Constants::TYPE_POSSESSIONS_SIZE; ++index) {
|
||||
for (int16 index = SLOT_BEGIN; index < EQEmu::constants::TYPE_POSSESSIONS_SIZE; ++index) {
|
||||
auto inst = m_inv[index];
|
||||
if (inst == nullptr) { continue; }
|
||||
instmap[index] = inst;
|
||||
}
|
||||
for (int16 index = EQEmu::Constants::TRIBUTE_BEGIN; index <= EQEmu::Constants::TRIBUTE_END; ++index) {
|
||||
for (int16 index = EQEmu::constants::TRIBUTE_BEGIN; index <= EQEmu::constants::TRIBUTE_END; ++index) {
|
||||
auto inst = m_inv[index];
|
||||
if (inst == nullptr) { continue; }
|
||||
instmap[index] = inst;
|
||||
}
|
||||
for (int16 index = EQEmu::Constants::BANK_BEGIN; index <= EQEmu::Constants::BANK_END; ++index) {
|
||||
for (int16 index = EQEmu::constants::BANK_BEGIN; index <= EQEmu::constants::BANK_END; ++index) {
|
||||
auto inst = m_inv[index];
|
||||
if (inst == nullptr) { continue; }
|
||||
instmap[index] = inst;
|
||||
}
|
||||
for (int16 index = EQEmu::Constants::SHARED_BANK_BEGIN; index <= EQEmu::Constants::SHARED_BANK_END; ++index) {
|
||||
for (int16 index = EQEmu::constants::SHARED_BANK_BEGIN; index <= EQEmu::constants::SHARED_BANK_END; ++index) {
|
||||
auto inst = m_inv[index];
|
||||
if (inst == nullptr) { continue; }
|
||||
instmap[index] = inst;
|
||||
}
|
||||
for (int16 index = EQEmu::Constants::TRADE_BEGIN; index <= EQEmu::Constants::TRADE_END; ++index) {
|
||||
for (int16 index = EQEmu::constants::TRADE_BEGIN; index <= EQEmu::constants::TRADE_END; ++index) {
|
||||
auto inst = m_inv[index];
|
||||
if (inst == nullptr) { continue; }
|
||||
instmap[index] = inst;
|
||||
@@ -3074,10 +3074,10 @@ bool Client::InterrogateInventory(Client* requester, bool log, bool silent, bool
|
||||
|
||||
auto tsobject = GetTradeskillObject();
|
||||
if (tsobject != nullptr) {
|
||||
for (int16 index = SLOT_BEGIN; index < EQEmu::Constants::TYPE_WORLD_SIZE; ++index) {
|
||||
for (int16 index = SLOT_BEGIN; index < EQEmu::constants::TYPE_WORLD_SIZE; ++index) {
|
||||
auto inst = tsobject->GetItem(index);
|
||||
if (inst == nullptr) { continue; }
|
||||
instmap[EQEmu::Constants::WORLD_BEGIN + index] = inst;
|
||||
instmap[EQEmu::constants::WORLD_BEGIN + index] = inst;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3149,7 +3149,7 @@ void Client::InterrogateInventory_(bool errorcheck, Client* requester, int16 hea
|
||||
}
|
||||
else {
|
||||
if (inst) {
|
||||
for (int16 sub = SUB_BEGIN; (sub < EQEmu::Constants::ITEM_CONTAINER_SIZE) && (!error); ++sub) { // treat any ItemInst as having the max internal slots available
|
||||
for (int16 sub = SUB_INDEX_BEGIN; (sub < EQEmu::constants::ITEM_CONTAINER_SIZE) && (!error); ++sub) { // treat any ItemInst as having the max internal slots available
|
||||
if (inst->GetItem(sub))
|
||||
InterrogateInventory_(true, requester, head, sub, inst->GetItem(sub), inst, log, silent, error, depth + 1);
|
||||
}
|
||||
@@ -3179,7 +3179,7 @@ void Client::InterrogateInventory_(bool errorcheck, Client* requester, int16 hea
|
||||
}
|
||||
|
||||
if (inst) {
|
||||
for (int16 sub = SUB_BEGIN; (sub < EQEmu::Constants::ITEM_CONTAINER_SIZE); ++sub) {
|
||||
for (int16 sub = SUB_INDEX_BEGIN; (sub < EQEmu::constants::ITEM_CONTAINER_SIZE); ++sub) {
|
||||
if (inst->GetItem(sub))
|
||||
InterrogateInventory_(false, requester, head, sub, inst->GetItem(sub), inst, log, silent, error, depth + 1);
|
||||
}
|
||||
@@ -3194,9 +3194,9 @@ bool Client::InterrogateInventory_error(int16 head, int16 index, const ItemInst*
|
||||
// very basic error checking - can be elaborated upon if more in-depth testing is needed...
|
||||
|
||||
if (
|
||||
(head >= EQEmu::Constants::EQUIPMENT_BEGIN && head <= EQEmu::Constants::EQUIPMENT_END) ||
|
||||
(head >= EQEmu::Constants::TRIBUTE_BEGIN && head <= EQEmu::Constants::TRIBUTE_END) ||
|
||||
(head >= EQEmu::Constants::WORLD_BEGIN && head <= EQEmu::Constants::WORLD_END) ||
|
||||
(head >= EQEmu::constants::EQUIPMENT_BEGIN && head <= EQEmu::constants::EQUIPMENT_END) ||
|
||||
(head >= EQEmu::constants::TRIBUTE_BEGIN && head <= EQEmu::constants::TRIBUTE_END) ||
|
||||
(head >= EQEmu::constants::WORLD_BEGIN && head <= EQEmu::constants::WORLD_END) ||
|
||||
(head >= 8000 && head <= 8101) ||
|
||||
(head == SlotPowerSource)) {
|
||||
switch (depth)
|
||||
@@ -3210,7 +3210,7 @@ bool Client::InterrogateInventory_error(int16 head, int16 index, const ItemInst*
|
||||
return true;
|
||||
if (!parent->IsType(ItemClassCommon))
|
||||
return true;
|
||||
if (index >= EQEmu::Constants::ITEM_COMMON_SIZE)
|
||||
if (index >= EQEmu::constants::ITEM_COMMON_SIZE)
|
||||
return true;
|
||||
break;
|
||||
default: // requirement: none (something bad happened...)
|
||||
@@ -3218,11 +3218,11 @@ bool Client::InterrogateInventory_error(int16 head, int16 index, const ItemInst*
|
||||
}
|
||||
}
|
||||
else if (
|
||||
(head >= EQEmu::Constants::GENERAL_BEGIN && head <= EQEmu::Constants::GENERAL_END) ||
|
||||
(head >= EQEmu::constants::GENERAL_BEGIN && head <= EQEmu::constants::GENERAL_END) ||
|
||||
(head == SlotCursor) ||
|
||||
(head >= EQEmu::Constants::BANK_BEGIN && head <= EQEmu::Constants::BANK_END) ||
|
||||
(head >= EQEmu::Constants::SHARED_BANK_BEGIN && head <= EQEmu::Constants::SHARED_BANK_END) ||
|
||||
(head >= EQEmu::Constants::TRADE_BEGIN && head <= EQEmu::Constants::TRADE_END)) {
|
||||
(head >= EQEmu::constants::BANK_BEGIN && head <= EQEmu::constants::BANK_END) ||
|
||||
(head >= EQEmu::constants::SHARED_BANK_BEGIN && head <= EQEmu::constants::SHARED_BANK_END) ||
|
||||
(head >= EQEmu::constants::TRADE_BEGIN && head <= EQEmu::constants::TRADE_END)) {
|
||||
switch (depth)
|
||||
{
|
||||
case 0: // requirement: inst is extant
|
||||
@@ -3239,7 +3239,7 @@ bool Client::InterrogateInventory_error(int16 head, int16 index, const ItemInst*
|
||||
if (parent->IsType(ItemClassCommon)) {
|
||||
if (!(inst->GetItem()->AugType > 0))
|
||||
return true;
|
||||
if (index >= EQEmu::Constants::ITEM_COMMON_SIZE)
|
||||
if (index >= EQEmu::constants::ITEM_COMMON_SIZE)
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
@@ -3253,7 +3253,7 @@ bool Client::InterrogateInventory_error(int16 head, int16 index, const ItemInst*
|
||||
if (parent->IsType(ItemClassCommon)) {
|
||||
if (!(inst->GetItem()->AugType > 0))
|
||||
return true;
|
||||
if (index >= EQEmu::Constants::ITEM_COMMON_SIZE)
|
||||
if (index >= EQEmu::constants::ITEM_COMMON_SIZE)
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user