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

This subforum contains all the issues which we already resolved.
Post Reply
User avatar
raiguard
Factorio Staff
Factorio Staff
Posts: 449
Joined: Wed Dec 13, 2017 8:29 pm
Contact:

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

Post 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})
Don't forget, you're here forever.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13177
Joined: Wed Jun 11, 2014 5:23 am
Contact:

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

Post by Rseding91 »

Thanks for the report. It's now fixed for the next release.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Resolved Problems and Bugs”