[Rseding91] [1.0.0] LuaControl::can_insert has incorrect behavior for modules
Posted: Mon Sep 14, 2020 3:32 am
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
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})