[0.12]LuaPlayer.can_insert() [kovarex] unexpected behaviour

This subforum contains all the issues which we already resolved.
Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

[0.12]LuaPlayer.can_insert() [kovarex] unexpected behaviour

Post by Choumiko »

Pretty minor but:
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
I'd expect to see "Inventory full", instead i get "Cannot insert Rocket Silo. Player's inventory full."
kovarex
Factorio Staff
Factorio Staff
Posts: 8298
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: [0.12]LuaPlayer.can_insert() [kovarex] unexpected behaviour

Post by kovarex »

Thanks for the report, it is fixed for 0.12.5.
Post Reply

Return to “Resolved Problems and Bugs”