Project Red - Core

Project Red - Core

43M Downloads

[Bug] Incorrect Comparator Output (Addition Mode)

stachurr opened this issue · 2 comments

commented

Minecraft version

1.19.2

CodeChickenLib version

4.3.2.490

CBMultipart version

3.2.0.139

ProjectRed version

4.17.0-beta+13

Forge version

43.3.9

What happened?

The output of the Comparator gate when in addition mode is incorrect for the majority of input combinations.
project-red-comparator-addition-bug

Wow sorry for the awful gif quality lol. Here's what I see:

6+0=6
6+1=7
6+2=6
6+3=7
6+4=6
6+5=7
6+6=0
6+7=0
6+8=E
6+9=F
6+A=E
6+B=F
6+C=E
6+D=F
6+E=0 
6+F=0

Crash log

n/a

How do you make it happen again?

n/a

commented

Hi. You may want to check how the vanilla Comparator gate works. The two modes are:

  1. Comparison mode (output = rear × [left ≤ rear AND right ≤ rear])
  2. Subtraction mode (output = max(rear - max(left, right), 0))

That being said, comparison mode should not be outputting anything other than the incoming signal of 6 in your above example. Will investigate

commented

Ah my mistake, thank you