InfiniteInventory Continued


Republish of Qon's InfiniteInventory updated for Factorio 2.0. Original mod by Qon, with code credit to DedlySpyder's First One's Free.

Utilities
a month ago
2.0
107
Storage Cheats

g Error when in remote view

14 days ago

I'm getting this error:

The mod InfiniteInventory Continued (2.0.0) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event InfiniteInventory-continued::on_nth_tick(60)
InfiniteInventory-continued/control.lua:70: attempt to index local 'main_inv' (a nil value)
stack traceback:
InfiniteInventory-continued/control.lua:70: in function 'changeInventorySlots'
InfiniteInventory-continued/control.lua:44: in function <InfiniteInventory-continued/control.lua:35>

In changeInventorySlots() (line 69–70), the mod calls player.get_main_inventory() and immediately indexes the result. That function can return nil even when player.character exists - typically when in remote/map view. The 60-tick timer (on_nth_tick(60)) queued a pending resize, fired while the inventory was inaccessible, and crashes.

Would you be open to a tweak that bails out safely if the inventory isn't available?

local main_inv = player.get_main_inventory()
if not (main_inv and main_inv.valid) then return end

New response