mirror of
https://github.com/islehorse/HISP.git
synced 2025-04-06 13:15:42 +12:00
Fix trading not working if inv full
This commit is contained in:
parent
40f76ede4f
commit
2d234bdc1c
1 changed files with 17 additions and 11 deletions
|
@ -130,18 +130,20 @@ namespace HISP.Player
|
|||
*/
|
||||
|
||||
bool itemYouFail = false;
|
||||
foreach (ItemInstance[] inst in OtherTrade.ItemsOffered)
|
||||
if (OtherTrade.ItemsOffered.Length > 0)
|
||||
{
|
||||
if (Trader.Inventory.HasItemId(inst[0].ItemId))
|
||||
foreach (ItemInstance[] inst in OtherTrade.ItemsOffered)
|
||||
{
|
||||
InventoryItem items = Trader.Inventory.GetItemByItemId(inst[0].ItemId);
|
||||
if (items.ItemInstances.Length + inst.Length > ConfigReader.MAX_STACK)
|
||||
if (Trader.Inventory.HasItemId(inst[0].ItemId))
|
||||
{
|
||||
itemYouFail = true;
|
||||
InventoryItem items = Trader.Inventory.GetItemByItemId(inst[0].ItemId);
|
||||
if (items.ItemInstances.Length + inst.Length > ConfigReader.MAX_STACK)
|
||||
{
|
||||
itemYouFail = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (itemYouFail)
|
||||
{
|
||||
fail = true;
|
||||
|
@ -150,14 +152,18 @@ namespace HISP.Player
|
|||
}
|
||||
|
||||
bool itemOtherFail = false;
|
||||
foreach (ItemInstance[] inst in ItemsOffered)
|
||||
if (ItemsOffered.Length > 0)
|
||||
{
|
||||
if (OtherTrade.Trader.Inventory.HasItemId(inst[0].ItemId))
|
||||
|
||||
foreach (ItemInstance[] inst in ItemsOffered)
|
||||
{
|
||||
InventoryItem items = OtherTrade.Trader.Inventory.GetItemByItemId(inst[0].ItemId);
|
||||
if (items.ItemInstances.Length + inst.Length > ConfigReader.MAX_STACK)
|
||||
if (OtherTrade.Trader.Inventory.HasItemId(inst[0].ItemId))
|
||||
{
|
||||
itemOtherFail = true;
|
||||
InventoryItem items = OtherTrade.Trader.Inventory.GetItemByItemId(inst[0].ItemId);
|
||||
if (items.ItemInstances.Length + inst.Length > ConfigReader.MAX_STACK)
|
||||
{
|
||||
itemOtherFail = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue