Page 1 of 1

[Rseding91] [1.0.0] LuaControl::can_insert has incorrect behavior for modules

Posted: Mon Sep 14, 2020 3:32 am
by raiguard
When using LuaControl::can_insert, strange behavior can be observed when it comes to modules. If a module is in the entity's module inventory, whether or not that inventory is full, calling can_insert and passing that module into it will always return true. This does not happen for any other inventory type that I've been able to find.

To reproduce:
- Place an assembling machine 3
- Set it to any recipe (how about Processing unit?)
- Insert four speed module 3's
- Hover the mouse over the entity
- Run the provided command below
- Observe that the function will return true despite the fact that the module inventory is full

Code: Select all

/c game.print(game.player.selected.can_insert{name="speed-module-3", count=10})

Re: [1.0.0] LuaControl::can_insert has incorrect behavior for modules

Posted: Mon Sep 14, 2020 4:24 pm
by Rseding91
Thanks for the report. It's now fixed for the next release.