[0.10.x] caninsert() while toolbelt is filtered wrong
Posted: Thu Aug 21, 2014 7:23 am
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:
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.
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.