Added new protection on TradeList.

This commit is contained in:
MobiusDevelopment 2022-01-19 22:54:39 +00:00
parent 173223bc61
commit 9867c4ee1c
2 changed files with 2 additions and 4 deletions

View File

@ -351,14 +351,13 @@ public class TradeList
return null;
}
if (count > item.getCount())
if ((count <= 0) || (count > item.getCount()))
{
return null;
}
if (!item.isStackable() && (count > 1))
{
LOGGER.warning(_owner.getName() + ": Attempt to add non-stackable item to TradeList with count > 1!");
return null;
}

View File

@ -363,14 +363,13 @@ public class TradeList
return null;
}
if (count > item.getCount())
if ((count <= 0) || (count > item.getCount()))
{
return null;
}
if (!item.isStackable() && (count > 1))
{
LOGGER.warning(_owner.getName() + ": Attempt to add non-stackable item to TradeList with count > 1!");
return null;
}