This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
KnightMiner's profile picture

[1.74] Colors.subtract returns the original value instead of a subtracted value

Started by KnightMiner, 19 October 2015 - 04:00 PM
KnightMiner #1
Posted 19 October 2015 - 06:00 PM
Version:
1.74, tested without any other mods

Description:
Attempting to use colors.subtract returned the original value, causing the redstone program to be unable to turn off a colored cable

Expected result:
colors.subtract would return the value after "subtracting" the color.

Reproduction steps:
Type the following command into a computer. Notice it returns 13 (the combination of the colors) instead of the expected 9 (the combination minus magenta)

print(colors.subtract(colors.combine(colors.white, colors.magenta, colours.lightBlue), colors.magenta))

Notes:
I am unsure if the issue is caused by the bit32 API not working right or by colors.subtract having an issue in its coding, as I don't really understand what bit32 is doing at this time.
Edited on 19 October 2015 - 04:01 PM
Bomb Bloke #2
Posted 19 October 2015 - 10:25 PM
Notes:
I am unsure if the issue is caused by the bit32 API not working right or by colors.subtract having an issue in its coding, as I don't really understand what bit32 is doing at this time.

It's indeed an issue within bit.
KnightMiner #3
Posted 20 October 2015 - 12:26 AM
It seems I missed that topic in my search for "colors.subtract" (that search bar seems very broken…).

Is it worth keeping this issue separate, as this one could technically be fixed without fixing the other? (by using another method to handle colors.subtract that is)
KingofGamesYami #4
Posted 20 October 2015 - 01:29 AM
It seems I missed that topic in my search for "colors.subtract" (that search bar seems very broken…).

Here's a better search (site:computercraft.info tells google to search this site only)
dan200 #5
Posted 11 December 2015 - 03:17 PM
Fixed in 1.75