From 47db92cdb64aaad5a86aa9db9cbbcd40109d7fd3 Mon Sep 17 00:00:00 2001 From: Paul Coene Date: Sun, 29 Oct 2023 09:50:04 -0400 Subject: [PATCH] [Trading] Fix part 3 of Issue 932. (#3654) --- zone/trading.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/zone/trading.cpp b/zone/trading.cpp index da90dd91d..c0b34ef67 100644 --- a/zone/trading.cpp +++ b/zone/trading.cpp @@ -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 - if (!quest_npc) + // Regardless of quest or non-quest NPC - No in combat trade completion + // 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) { if (!inst || !inst->GetItem()) {