Ancient Warfare 2

Ancient Warfare 2

6M Downloads

Warehouse Interface works wrong with filters quantity

romeoordos opened this issue ยท 0 comments

commented

Hi! I have noticed that warehouse's interface doesn't move items to storage if their quantity becomes more than requested by interface's filter. I propose next solution to fix this issue:

This part of code moves all stackes that have item quantity above filter requirement back to storage:

TileWarehouseInterface:206

if(count > filter.getFilterQuantity())
{
  for(int i = 0; i< inventory.getSizeInventory(); i++)
  {
    stack = inventory.getStackInSlot(i);
    if(stack==null){continue;}
    if(matchesFilter(stack))
    {
        emptyRequests.add(new InterfaceEmptyRequest(i));
        count = count - stack.stackSize;
        if(count <= filter.getFilterQuantity()) break;
    }
  }
}

This part of code adds only required amount of items from storage to interface instead of full stack:

TileWarehouseBase.java:248

stack.stackSize = request.requestAmount  > stack.stackSize ? stack.stackSize : request.requestAmount;

These changes should be applied to 7aa0818 cause I had no luck to use more recent one with my current mods setup.