From dd7a59b451e9d4d8d99c3bec15b330cf60dded2f Mon Sep 17 00:00:00 2001 From: Coruja Date: Tue, 2 Aug 2016 02:07:12 -0300 Subject: [PATCH] Fixed: Items inside trade window not firing @DropOn_Item trigger when the trade move the item to player bacpkack --- docs/REVISIONS-56-SERIES.TXT | 6 +++++- src/graysvr/CCharact.cpp | 9 +++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/docs/REVISIONS-56-SERIES.TXT b/docs/REVISIONS-56-SERIES.TXT index 6636c6929..6a4058296 100644 --- a/docs/REVISIONS-56-SERIES.TXT +++ b/docs/REVISIONS-56-SERIES.TXT @@ -135,4 +135,8 @@ Fixed: Function MOVENEAR not working correctly. 23-07-2016, Coruja Fixed: Corpses being created without MORE2 set (last attacker UID) when the char die. -Changed: Updated pick/drop sound on items/containers. \ No newline at end of file +Changed: Updated pick/drop sound on items/containers. + +01-08-2016, Coruja +Fixed: Items inside trade window not firing @DropOn_Item trigger when the trade move the item to player bacpkack. + PS: Using return 1 here will not cancel the trade, this must be done directly on @TradeAccepted/@CharTradeAccepted triggers. \ No newline at end of file diff --git a/src/graysvr/CCharact.cpp b/src/graysvr/CCharact.cpp index 6f646f5a5..5c640d15c 100644 --- a/src/graysvr/CCharact.cpp +++ b/src/graysvr/CCharact.cpp @@ -1774,6 +1774,15 @@ bool CChar::ItemBounce( CItem * pItem, bool bDisplayMsg ) LPCTSTR pszWhere = NULL; if ( pPack && CanCarry(pItem) ) // this can happen at load time { + if ( IsTrigUsed(TRIGGER_DROPON_ITEM) ) + { + CScriptTriggerArgs Args(pPack); + pItem->OnTrigger(ITRIG_DROPON_ITEM, this, &Args); + + if ( pItem->IsDeleted() ) // the trigger had deleted the item + return false; + } + pszWhere = g_Cfg.GetDefaultMsg( DEFMSG_MSG_BOUNCE_PACK ); pItem->RemoveFromView(); pPack->ContentAdd(pItem); // add it to pack