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

This subforum contains all the issues which we already resolved.
Post Reply
Rseding91
Factorio Staff
Factorio Staff
Posts: 12283
Joined: Wed Jun 11, 2014 5:23 am
Contact:

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

Post 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.
If you want to get ahold of me I'm almost always on Discord.

kovarex
Factorio Staff
Factorio Staff
Posts: 8058
Joined: Wed Feb 06, 2013 12:00 am
Contact:

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

Post by kovarex »

Thank you for the report, it is fixed for 0.10.9 now.

Post Reply

Return to “Resolved Problems and Bugs”