mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-20 00:51:28 +00:00
[Bug Fix] Fix _PutItem having a slot_id of -1 on mobs with no items (#3474)
# Notes - This was causing an insane amount of error logs because we were always using `PutItem`, even with a `slot_id` of `-1`.
This commit is contained in:
parent
4a9a9fa197
commit
bc71997518
@ -1444,7 +1444,7 @@ int16 EQ::InventoryProfile::_PutItem(int16 slot_id, ItemInstance* inst)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (result == INVALID_INDEX) {
|
if (result == INVALID_INDEX) {
|
||||||
LogError("InventoryProfile::_PutItem: Invalid slot_id specified ({}) with parent slot id ({})", slot_id, parentSlot);
|
LogError("Invalid slot_id specified ({}) with parent slot id ({})", slot_id, parentSlot);
|
||||||
InventoryProfile::MarkDirty(inst); // Slot not found, clean up
|
InventoryProfile::MarkDirty(inst); // Slot not found, clean up
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -299,7 +299,7 @@ void NPC::AddLootDrop(
|
|||||||
uint32 aug6
|
uint32 aug6
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (item2 == nullptr) {
|
if (!item2) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -363,7 +363,7 @@ void NPC::AddLootDrop(
|
|||||||
|
|
||||||
bool found = false; // track if we found an empty slot we fit into
|
bool found = false; // track if we found an empty slot we fit into
|
||||||
|
|
||||||
int foundslot = -1; // for multi-slot items
|
int foundslot = INVALID_INDEX; // for multi-slot items
|
||||||
|
|
||||||
const auto* inst = database.CreateItem(
|
const auto* inst = database.CreateItem(
|
||||||
item2->ID,
|
item2->ID,
|
||||||
@ -376,6 +376,10 @@ void NPC::AddLootDrop(
|
|||||||
aug6
|
aug6
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (!inst) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (loot_drop.equip_item > 0) {
|
if (loot_drop.equip_item > 0) {
|
||||||
uint8 eslot = 0xFF;
|
uint8 eslot = 0xFF;
|
||||||
char newid[20];
|
char newid[20];
|
||||||
@ -524,7 +528,10 @@ void NPC::AddLootDrop(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (itemlist) {
|
if (itemlist) {
|
||||||
GetInv().PutItem(foundslot, *inst);
|
if (foundslot != INVALID_INDEX) {
|
||||||
|
GetInv().PutItem(foundslot, *inst);
|
||||||
|
}
|
||||||
|
|
||||||
itemlist->push_back(item);
|
itemlist->push_back(item);
|
||||||
} else {
|
} else {
|
||||||
safe_delete(item);
|
safe_delete(item);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user