fix: Reverts change for trade window that causes an exploit (#2189)

This commit is contained in:
Kamron Batman 2025-05-17 21:25:48 -07:00 committed by GitHub
parent c1d8606167
commit 972e7723ae
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -343,7 +343,28 @@ public partial class NetState : IComparable<NetState>, IValueLinkListNode<NetSta
return null;
}
public SecureTradeContainer FindTradeContainer(Mobile m) => FindTrade(m)?.From.Container;
public SecureTradeContainer FindTradeContainer(Mobile m)
{
for (var i = 0; i < Trades.Count; ++i)
{
var trade = Trades[i];
var from = trade.From;
var to = trade.To;
if (from.Mobile == Mobile && to.Mobile == m)
{
return from.Container;
}
if (from.Mobile == m && to.Mobile == Mobile)
{
return to.Container;
}
}
return null;
}
public SecureTradeContainer AddTrade(NetState state)
{