Skip to content

Commit

Permalink
[Loot] Remove unnecessary loot error messages. (#2261)
Browse files Browse the repository at this point in the history
* [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
  • Loading branch information
Kinglykrab committed Jun 12, 2022
1 parent b2658a6 commit be00aa1
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions zone/client_packet.cpp
Expand Up @@ -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<uint16>(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);
return;
}
else {
Message(Chat::Red, "Error: Corpse not found! (!ent->IsCorpse())");
if (!entity->IsCorpse()) {
Corpse::SendEndLootErrorPacket(this);
return;
}

return;
entity->CastToCorpse()->LootItem(this, app);
}

void Client::Handle_OP_LootRequest(const EQApplicationPacket *app)
Expand Down

0 comments on commit be00aa1

Please sign in to comment.