aebabis / factorio-state-machine

MIT License
15 stars 8 forks source link

A signal only used as input still creates a combinator #35

Closed TokMor closed 1 year ago

TokMor commented 2 years ago

Pretty sure this is a bug, but potentially is a "as expected". When a signal is only used as an input (I.E. used as the right side of an assignment string, never as the left side), there is still a tracking combinator created for it in the BP. Manually removing the combinator before turning on the S combinator corrects the issue. So ideally, the BP would not generate a tracking combinator for a signal unless it appears on the left side of an assignment string. image In the example above, the D constant combinator is set to 10, and that amount is added to the total every tick. The boxed D+0=>D arithmetic combinator should not have been output to the BP. Sample code to generate this: 10: A = D => 20 20: =>20

aebabis commented 2 years ago

I agree this is a bug. Would it be correct to say you haven't seen this except for RHS-only combinators? It should be easy enough to remove RHS signals from the symbol table.

TokMor commented 2 years ago

Correct. This only happens where I'm reading signals I use as inputs that other circuits are generating such as a status or initial settings.

aebabis commented 2 years ago

This should be working now. Please let me know

https://github.com/aebabis/factorio-state-machine/commit/32506525eddb400c35a4c08c7fecd8af2445df79

TokMor commented 1 year ago

Again, my apologies it took a while for me to get back to this project. But this looks like it is working properly now.

Thanks for fixing!