mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 03:08:26 +00:00
Moved struct Item_Struct into namespace EQEmu
This commit is contained in:
+20
-20
@@ -266,7 +266,7 @@ void Trade::LogTrade()
|
||||
sprintf(item_num, "%i", inst->GetItem()->ID);
|
||||
strcat(logtext, item_num);
|
||||
|
||||
if (inst->IsType(ItemClassContainer)) {
|
||||
if (inst->IsClassBag()) {
|
||||
for (uint8 j = SUB_INDEX_BEGIN; j < EQEmu::legacy::ITEM_CONTAINER_SIZE; j++) {
|
||||
inst = trader->GetInv().GetItem(i, j);
|
||||
if (inst) {
|
||||
@@ -309,9 +309,9 @@ void Trade::DumpTrade()
|
||||
if (inst) {
|
||||
Log.Out(Logs::Detail, Logs::Trading, "Item %i (Charges=%i, Slot=%i, IsBag=%s)",
|
||||
inst->GetItem()->ID, inst->GetCharges(),
|
||||
i, ((inst->IsType(ItemClassContainer)) ? "True" : "False"));
|
||||
i, ((inst->IsClassBag()) ? "True" : "False"));
|
||||
|
||||
if (inst->IsType(ItemClassContainer)) {
|
||||
if (inst->IsClassBag()) {
|
||||
for (uint8 j = SUB_INDEX_BEGIN; j < EQEmu::legacy::ITEM_CONTAINER_SIZE; j++) {
|
||||
inst = trader->GetInv().GetItem(i, j);
|
||||
if (inst) {
|
||||
@@ -335,7 +335,7 @@ void Client::ResetTrade() {
|
||||
for (int16 trade_slot = EQEmu::legacy::TRADE_BEGIN; trade_slot <= EQEmu::legacy::TRADE_END; ++trade_slot) {
|
||||
const ItemInst* inst = m_inv[trade_slot];
|
||||
|
||||
if (inst && inst->IsType(ItemClassContainer)) {
|
||||
if (inst && inst->IsClassBag()) {
|
||||
int16 free_slot = m_inv.FindFreeSlotForTradeItem(inst);
|
||||
|
||||
if (free_slot != INVALID_INDEX) {
|
||||
@@ -490,7 +490,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
|
||||
for (int16 trade_slot = EQEmu::legacy::TRADE_BEGIN; trade_slot <= EQEmu::legacy::TRADE_END; ++trade_slot) {
|
||||
const ItemInst* inst = m_inv[trade_slot];
|
||||
|
||||
if (inst && inst->IsType(ItemClassContainer)) {
|
||||
if (inst && inst->IsClassBag()) {
|
||||
Log.Out(Logs::Detail, Logs::Trading, "Giving container %s (%d) in slot %d to %s", inst->GetItem()->Name, inst->GetItem()->ID, trade_slot, other->GetName());
|
||||
|
||||
// TODO: need to check bag items/augments for no drop..everything for attuned...
|
||||
@@ -840,7 +840,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
|
||||
event_details->push_back(detail);
|
||||
qs_audit->char_count += detail->charges;
|
||||
|
||||
if(trade_inst->IsType(ItemClassContainer)) {
|
||||
if (trade_inst->IsClassBag()) {
|
||||
for (uint8 sub_slot = SUB_INDEX_BEGIN; sub_slot < trade_inst->GetItem()->BagSlots; ++sub_slot) {
|
||||
const ItemInst* trade_baginst = trade_inst->GetItem(sub_slot);
|
||||
|
||||
@@ -885,16 +885,16 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
|
||||
continue;
|
||||
}
|
||||
|
||||
const Item_Struct* item = inst->GetItem();
|
||||
const EQEmu::Item_Struct* item = inst->GetItem();
|
||||
if(item && quest_npc == false) {
|
||||
// if it was not a NO DROP or Attuned item (or if a GM is trading), let the NPC have it
|
||||
if(GetGM() || (item->NoDrop != 0 && inst->IsAttuned() == false)) {
|
||||
// pets need to look inside bags and try to equip items found there
|
||||
if(item->ItemClass == ItemClassContainer && item->BagSlots > 0) {
|
||||
if (item->IsClassBag() && item->BagSlots > 0) {
|
||||
for (int16 bslot = SUB_INDEX_BEGIN; bslot < item->BagSlots; bslot++) {
|
||||
const ItemInst* baginst = inst->GetItem(bslot);
|
||||
if (baginst) {
|
||||
const Item_Struct* bagitem = baginst->GetItem();
|
||||
const EQEmu::Item_Struct* bagitem = baginst->GetItem();
|
||||
if (bagitem && (GetGM() || (bagitem->NoDrop != 0 && baginst->IsAttuned() == false))) {
|
||||
tradingWith->CastToNPC()->AddLootDrop(bagitem, &tradingWith->CastToNPC()->itemlist,
|
||||
baginst->GetCharges(), 1, 127, true, true);
|
||||
@@ -1158,7 +1158,7 @@ void Client::SendTraderItem(uint32 ItemID, uint16 Quantity) {
|
||||
std::string Packet;
|
||||
int16 FreeSlotID=0;
|
||||
|
||||
const Item_Struct* item = database.GetItem(ItemID);
|
||||
const EQEmu::Item_Struct* item = database.GetItem(ItemID);
|
||||
|
||||
if(!item){
|
||||
Log.Out(Logs::Detail, Logs::Trading, "Bogus item deleted in Client::SendTraderItem!\n");
|
||||
@@ -1169,7 +1169,7 @@ void Client::SendTraderItem(uint32 ItemID, uint16 Quantity) {
|
||||
|
||||
if (inst)
|
||||
{
|
||||
bool is_arrow = (inst->GetItem()->ItemType == ItemTypeArrow) ? true : false;
|
||||
bool is_arrow = (inst->GetItem()->ItemType == EQEmu::item::ItemTypeArrow) ? true : false;
|
||||
FreeSlotID = m_inv.FindFreeSlot(false, true, inst->GetItem()->Size, is_arrow);
|
||||
|
||||
PutItemInInventory(FreeSlotID, *inst);
|
||||
@@ -1192,7 +1192,7 @@ void Client::SendSingleTraderItem(uint32 CharID, int SerialNumber) {
|
||||
}
|
||||
|
||||
void Client::BulkSendTraderInventory(uint32 char_id) {
|
||||
const Item_Struct *item;
|
||||
const EQEmu::Item_Struct *item;
|
||||
|
||||
TraderCharges_Struct* TraderItems = database.LoadTraderItemWithCharges(char_id);
|
||||
|
||||
@@ -2030,7 +2030,7 @@ static void UpdateTraderCustomerItemsAdded(uint32 CustomerID, TraderCharges_Stru
|
||||
|
||||
if(!Customer) return;
|
||||
|
||||
const Item_Struct *item = database.GetItem(ItemID);
|
||||
const EQEmu::Item_Struct *item = database.GetItem(ItemID);
|
||||
|
||||
if(!item) return;
|
||||
|
||||
@@ -2074,7 +2074,7 @@ static void UpdateTraderCustomerPriceChanged(uint32 CustomerID, TraderCharges_St
|
||||
|
||||
if(!Customer) return;
|
||||
|
||||
const Item_Struct *item = database.GetItem(ItemID);
|
||||
const EQEmu::Item_Struct *item = database.GetItem(ItemID);
|
||||
|
||||
if(!item) return;
|
||||
|
||||
@@ -2233,7 +2233,7 @@ void Client::HandleTraderPriceUpdate(const EQApplicationPacket *app) {
|
||||
}
|
||||
|
||||
|
||||
const Item_Struct *item = 0;
|
||||
const EQEmu::Item_Struct *item = 0;
|
||||
|
||||
if(IDOfItemToAdd)
|
||||
item = database.GetItem(IDOfItemToAdd);
|
||||
@@ -2399,7 +2399,7 @@ void Client::SendBuyerResults(char* searchString, uint32 searchID) {
|
||||
|
||||
char *buf = (char *)outapp->pBuffer;
|
||||
|
||||
const Item_Struct* item = database.GetItem(itemID);
|
||||
const EQEmu::Item_Struct* item = database.GetItem(itemID);
|
||||
|
||||
if(!item) {
|
||||
safe_delete(outapp);
|
||||
@@ -2495,7 +2495,7 @@ void Client::ShowBuyLines(const EQApplicationPacket *app) {
|
||||
|
||||
char *Buf = (char *)outapp->pBuffer;
|
||||
|
||||
const Item_Struct* item = database.GetItem(ItemID);
|
||||
const EQEmu::Item_Struct* item = database.GetItem(ItemID);
|
||||
|
||||
if(!item) {
|
||||
safe_delete(outapp);
|
||||
@@ -2539,7 +2539,7 @@ void Client::SellToBuyer(const EQApplicationPacket *app) {
|
||||
/*uint32 BuyerID2 =*/ VARSTRUCT_SKIP_TYPE(uint32, Buf); //unused
|
||||
/*uint32 Unknown3 =*/ VARSTRUCT_SKIP_TYPE(uint32, Buf); //unused
|
||||
|
||||
const Item_Struct *item = database.GetItem(ItemID);
|
||||
const EQEmu::Item_Struct *item = database.GetItem(ItemID);
|
||||
|
||||
if(!item || !Quantity || !Price || !QtyBuyerWants) return;
|
||||
|
||||
@@ -2930,7 +2930,7 @@ void Client::UpdateBuyLine(const EQApplicationPacket *app) {
|
||||
/*uint32 UnknownZ =*/ VARSTRUCT_SKIP_TYPE(uint32, Buf); //unused
|
||||
uint32 ItemCount = VARSTRUCT_DECODE_TYPE(uint32, Buf);
|
||||
|
||||
const Item_Struct *item = database.GetItem(ItemID);
|
||||
const EQEmu::Item_Struct *item = database.GetItem(ItemID);
|
||||
|
||||
if(!item) return;
|
||||
|
||||
@@ -2994,7 +2994,7 @@ void Client::BuyerItemSearch(const EQApplicationPacket *app) {
|
||||
|
||||
BuyerItemSearchResults_Struct* bisr = (BuyerItemSearchResults_Struct*)outapp->pBuffer;
|
||||
|
||||
const Item_Struct* item = 0;
|
||||
const EQEmu::Item_Struct* item = 0;
|
||||
|
||||
int Count=0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user