From be00aa1b60b778fcf2450bc7f359eae1ca48a2af Mon Sep 17 00:00:00 2001 From: Kinglykrab <89047260+Kinglykrab@users.noreply.github.com> Date: Sun, 12 Jun 2022 18:44:16 -0400 Subject: [PATCH] [Loot] Remove unnecessary loot error messages. (#2261) * [Loot] Remove unnecessary loot error messages. These messages are only sent when you loot a corpse that is mid-decay (i.e. no items and you go to loot it immediately) or if you try to loot a non-corpse entity. The ent != 0 shows up a lot if you're trying to loot too quickly and really isn't an error, the server just hasn't caught up to decay the corpse before you try to loot. * Use preexisting struct. * Remove newline. * Update client_packet.cpp --- zone/client_packet.cpp | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index cfa2c2324..85ccd9b81 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -9531,26 +9531,21 @@ void Client::Handle_OP_LootItem(const EQApplicationPacket *app) return; } - EQApplicationPacket* outapp = nullptr; - Entity* entity = entity_list.GetID(*((uint16*)app->pBuffer)); - if (entity == 0) { - Message(Chat::Red, "Error: OP_LootItem: Corpse not found (ent = 0)"); - outapp = new EQApplicationPacket(OP_LootComplete, 0); + auto* l = (LootingItem_Struct*) app->pBuffer; + auto entity = entity_list.GetID(static_cast(l->lootee)); + if (!entity) { + auto outapp = new EQApplicationPacket(OP_LootComplete, 0); QueuePacket(outapp); safe_delete(outapp); return; } - if (entity->IsCorpse()) { - entity->CastToCorpse()->LootItem(this, app); + if (!entity->IsCorpse()) { + Corpse::SendEndLootErrorPacket(this); return; } - else { - Message(Chat::Red, "Error: Corpse not found! (!ent->IsCorpse())"); - Corpse::SendEndLootErrorPacket(this); - } - return; + entity->CastToCorpse()->LootItem(this, app); } void Client::Handle_OP_LootRequest(const EQApplicationPacket *app)