Complete freeze on battery insertion into large batbox

Thinking about it some…
I am pretty sure it’s to do with a stack entering the battery box where normally that wouldn’t be possible, i took a quick peek at code and didn’t find what i was expecting but whenever one shift clicks a stack of empty batteries into a battery box, they are split up into single stacks.
This obviously does not happen when using CTRL+SHIFT or W move (move to inventory above) with InvTweaks. Instead the game freezes, only one battery is inserted after reload and the others are lost to the void.

So i see two solutions to this problem.

  1. Check if any (greater than one) stacks of batteries sit inside the inventory of the battery box (and other similar machines with similar designs) and split them up. This can of course cause issues when no more inventory space is available to split said stack so… Eject any excess?
  2. Heck, check on every insertion into inventory if it’s a stack of batteries (stacked as in more than one) and split said stack and eject the ones that don’t fit.
  3. IMHO, the easiest and preferred method for this one… Simply make empty batteries a max stack size of one. Problem solved!
    It makes no sense to me how charged batteries suddenly grow in size by so much that they can no longer be stacked. (And yes, i understand the underlying reason for charged batteries not being stackable)
    So just make it so batteries (and other such items that may be inserted and freeze the game if they enter a inventory as a stack) simply cannot be stacked.

EDIT:
And yes, “stop using InvTweaks” is a solution. It’s just not my solution.

2 Likes