Page 1 of 1

Furnace or chemical plant blocked in middle of craft

Posted: Sun Jul 24, 2016 2:24 pm
by binbinhfr
Hi,

following my previous report, as Klonan asked, I make another specific report :

When the output of a furnace or a chemical plant is blocked (no inserters or no pipe to extract the products),
the machine is not crafting anymore, but still :
- the is_crafting() returns true
- the crafting_progress (and the progress bar) can be bloacked in the middle at 0.33 or 0.68 or whatever (even if most of the time,
it stops on 1).

on the following screencopies, the progress bar is stopped, and I checked that
/c game.player.print(tostring(game.player.selected.is_crafting())) returns true.

hard to detect that the machine is blocked...
is_crafting() should return false, or progress should always blocked at 1 ?
note that with item-assemblers, when output is blocked, is_crafting returns false and progress is blocked at 0, which is more logical.

example :
bug-craft-furnace.jpg
bug-craft-furnace.jpg (39.59 KiB) Viewed 981 times
bug-craft-chemical.jpg
bug-craft-chemical.jpg (60.42 KiB) Viewed 981 times

Re: Furnace or chemical plant blocked in middle of craft

Posted: Sun Jul 24, 2016 2:29 pm
by Rseding91
LuaEntity::is_crafting() is by definition true if the machine has a recipe and the progress is != 0.

Re: Furnace or chemical plant blocked in middle of craft

Posted: Sun Jul 24, 2016 2:41 pm
by binbinhfr
Rseding91 wrote:LuaEntity::is_crafting() is by definition true if the machine has a recipe and the progress is != 0.
So how can we detect if a machine is "working" or not ?
If it is blocked ?
There is no way to do this ? (it would be hard for cpu to continuously polling every machine to see if progress is stucked on a value...)
Don't you have an internal variable that could return this special status to the API ?

klonan said here viewtopic.php?f=23&t=29748&p=188359#p188393
Yes i think the crafting progress should be 1 when it is full at a blocked output
It could be a good solution.