From f799b8ef683e34cbc3559f257772a436f8136600 Mon Sep 17 00:00:00 2001 From: Trevius Date: Fri, 9 Jan 2015 20:16:23 -0600 Subject: [PATCH] Changed some console logging for slot and group errors. --- common/database.cpp | 3 ++- common/item.cpp | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/common/database.cpp b/common/database.cpp index d6dcd7405..39f78cfa6 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -3261,7 +3261,8 @@ uint32 Database::GetGroupID(const char* name){ if (results.RowCount() == 0) { - LogFile->write(EQEmuLog::Debug, "Character not in a group: %s", name); + // Commenting this out until logging levels can prevent this from going to console + //LogFile->write(EQEmuLog::Debug, "Character not in a group: %s", name); return 0; } diff --git a/common/item.cpp b/common/item.cpp index 7f6e049d6..c06df3a89 100644 --- a/common/item.cpp +++ b/common/item.cpp @@ -1108,6 +1108,7 @@ int16 Inventory::_PutItem(int16 slot_id, ItemInst* inst) } int16 result = INVALID_INDEX; + int16 parentSlot = INVALID_INDEX; if (slot_id == MainCursor) { // Replace current item on cursor, if exists @@ -1142,16 +1143,17 @@ int16 Inventory::_PutItem(int16 slot_id, ItemInst* inst) else { // Slot must be within a bag - ItemInst* baginst = GetItem(Inventory::CalcSlotId(slot_id)); // Get parent bag + parentSlot = Inventory::CalcSlotId(slot_id); + ItemInst* baginst = GetItem(parentSlot); // Get parent bag if (baginst && baginst->IsType(ItemClassContainer)) { baginst->_PutItem(Inventory::CalcBagIdx(slot_id), inst); result = slot_id; } } - + if (result == INVALID_INDEX) { - LogFile->write(EQEmuLog::Error, "Inventory::_PutItem: Invalid slot_id specified (%i)", slot_id); + LogFile->write(EQEmuLog::Error, "Inventory::_PutItem: Invalid slot_id specified (%i) with parent slot id (%i)", slot_id, parentSlot); Inventory::MarkDirty(inst); // Slot not found, clean up }