[Trading] Fix part 3 of Issue 932. (#3654)

This commit is contained in:
Paul Coene 2023-10-29 09:50:04 -04:00 committed by GitHub
parent 690301e80d
commit 47db92cdb6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -757,8 +757,22 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
} }
} }
// todo: rule or npc field to auto return normal items also // Regardless of quest or non-quest NPC - No in combat trade completion
if (!quest_npc) // is allowed.
if (tradingWith->CheckAggro(this))
{
for (EQ::ItemInstance* inst : items) {
if (!inst || !inst->GetItem()) {
continue;
}
tradingWith->SayString(TRADE_BACK, GetCleanName());
PushItemOnCursor(*inst, true);
}
}
// Only enforce trade rules if the NPC doesn't have an EVENT_TRADE
// subroutine. That overrides all.
else if (!quest_npc)
{ {
for (EQ::ItemInstance* inst : items) { for (EQ::ItemInstance* inst : items) {
if (!inst || !inst->GetItem()) { if (!inst || !inst->GetItem()) {