17.56 miner entity status inconsistent

Things that we don't consider worth fixing at this moment.
Post Reply
Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

17.56 miner entity status inconsistent

Post by Nexela »

Checking miner entity status on on_resource_depleted returns low_power

Place 2 resources down next to each other
/c game.player.surface.create_entity{position = game.player.position, name = 'iron-ore', amount =5}
place a chest, and a miner shoving things in it.
When the first resource is depleted low_power is returned, At this point I would still expect 'working'
When the second/last resource is depleted low_power is returned, At this point I would expect 'no_minable_resources'

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

Re: 17.56 miner entity status inconsistent

Post by Rseding91 »

Thanks for the re port however I don't consider this worth looking into. Reading the entity status is only useful at the end of the current tick after everything has had a chance to settle. Reading it in the middle of that event means it hasn't finished its update tick and electricity hasn't had a chance to flow into the entity. So, of course the status will be wrong.

The status was designed as a visual-only thing used in the GUI. The fact it's readable through the Lua API was only added because I knew someone would want to do it - even if I knew it wasn't going to be perfect.

So, I can either leave it as is, or remove the Lua API if enough people complain about it.
If you want to get ahold of me I'm almost always on Discord.


Post Reply

Return to “Won't fix.”