Existance of -0 while using Thoth's Gambit (Likely Bug)
Tinator500 opened this issue ยท 1 comments
While Writing a spell to calculate a 3x3 area in the direction the player is looking I ran into a problem with thoth's gambit. I gave it a list of all locations within a 3x3 cube sans corners. I then used the inverse of the absolute value of the face of the block in the direction I was facing to use as a key ie. if I am looking at 1 0 0 or -1 0 0 it would return 0 1 1. I then multiplied all locations in the original 3x3 area and multiplied each location by it's respective coordinate on the key to flatten it on whichever plane I was facing, after this multiplication I would remove all duplicates from the list the take the list and add the block the player is looking at to each of them, giving me a 3x3 of the block I am looking at and each block surrounding it based on the axis I am facing. However while debugging I realized that in my list of locations on the flattened cube there were occasional instances of -0 as part of the vectors.
If it helps I plan on using this spell to create a tunnel bore spell that works whichever way you are facing. The spell works in its completed form, but it breaks an average of 6 extra air blocks per layer each time I use it. Though I may have come up with a workaround for this specific instance by simply waiting to cull duplicates until after the player look block has been applied.