LuaPlayer.can_insert(stack) returns true if the only free slots are the logistics trash slots, calling .insert(stack) after can_insert returns true fails.
Reproduce:
- completely fill your inventory and quickbar
run these commands:
Code: Select all
/c
if game.player.can_insert{name="rocket-silo", count=1} then
game.player.insert{name="rocket-silo", count=1}
else
game.player.print("Inventory full")
end