Panakotta00 / FicsIt-Networks

Control, Monitor, Manage and Automate your Satisfactory.
https://ficsit.app/mod/FicsItNetworks
GNU General Public License v3.0
156 stars 51 forks source link

rail car inventory bug #186

Closed kfpopeye closed 2 years ago

kfpopeye commented 2 years ago

Whenever I print the inventory of a railcar filled with nitrogen, the stack.count is higher than the type.max. the max is always 50000 but the count is usually higher than 1 mil. See code:

function printInventory(invs, col)
 local i = 0
 local row = 6
 invs:sort()
 gpu2:setText(0, 5, "Inventories -----------------------------------------------------------------------------------------------")
 while (i < invs.Size) do
  local t = nil
  local stack = invs:getStack(i)
  if (stack.item) then t = stack.item.type end
  if(t) then
   local c = stack.count
   local m = t.max
   local n = string.sub(t.name, 1, 20)
   gpu2:setText(col, row, n .. ": " .. c .. "/" .. m)
   row = row + 1
  end
  i = i + 1
 end
 return row > 6
end
Panakotta00 commented 2 years ago

Fluids are special and dont really have a stack max... there is one tank that holds the stuff there are no "stacks" so to speak of