Skip to content

Commit

Permalink
Fixed: Items inside trade window not firing @DropOn_Item trigger when…
Browse files Browse the repository at this point in the history
… the trade move the item to player bacpkack
  • Loading branch information
coruja747 committed Aug 2, 2016
1 parent 279f726 commit dd7a59b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
6 changes: 5 additions & 1 deletion docs/REVISIONS-56-SERIES.TXT
Expand Up @@ -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.
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.
9 changes: 9 additions & 0 deletions src/graysvr/CCharact.cpp
Expand Up @@ -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
Expand Down

0 comments on commit dd7a59b

Please sign in to comment.