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'
17.56 miner entity status inconsistent
Re: 17.56 miner entity status inconsistent
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.
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.
Re: 17.56 miner entity status inconsistent
This one? https://lua-api.factorio.com/latest/Lua ... ity.status
Is here the event for it?
Is here the event for it?