Page 1 of 1

[0.10.x] caninsert() while toolbelt is filtered wrong

Posted: Thu Aug 21, 2014 7:23 am
by Rseding91
The "caninsert()" function for the players toolbelt always returns true even if the toolbelt is filtered to not allow what you're trying to insert.

Steps to reproduce:
  • Load any game
  • Filter the toolbar so all slots are filtered for raw-wood
  • Run this command from the console: game.player.print(tostring(game.player.getinventory(1).caninsert({name = "iron-ore", count = 50})))
  • Run this command from the console: game.player.getinventory(1).insert({name = "iron-ore", count = 50})

Note how the "caninsert" returns true but the insert fails (because the toolbelt is filtered). This may also apply to trains (as they can be filtered) but I didn't test them.

EDIT: erp.. meant to go in bug reports. If it could be moved that would be great.

Re: [0.10.x] caninsert() while toolbelt is filtered wrong

Posted: Fri Aug 22, 2014 11:42 am
by kovarex
Thank you for the report, it is fixed for 0.10.9 now.