Fixed AddItemToBotContainer not correctly finding container by index
This commit is contained in:
@@ -80,9 +80,11 @@ public class BotInventoryContainerService(ISptLogger<BotGeneratorHelper> logger,
|
||||
|
||||
// Try to fit item into one of the containers' grids
|
||||
var rootItem = itemAndChildren.FirstOrDefault();
|
||||
var gridIndex = 0;
|
||||
var gridIndex = -1;
|
||||
foreach (var gridDb in containerDetails.ContainerDbItem.Properties.Grids)
|
||||
{
|
||||
gridIndex++;
|
||||
|
||||
var gridDetails = containerDetails.ContainerGridDetails[gridIndex];
|
||||
if (gridDetails.GridFull)
|
||||
{
|
||||
@@ -133,8 +135,6 @@ public class BotInventoryContainerService(ISptLogger<BotGeneratorHelper> logger,
|
||||
break;
|
||||
}
|
||||
|
||||
gridIndex++;
|
||||
|
||||
// Didn't fit, flag as no space, hopefully next grid has space
|
||||
addResult = ItemAddedResult.NO_SPACE;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user