Fix indexing check for tile rotation

Closes #3950
Does not resolve #3953 , separate issue as caused by the April refactor. Need to debug old & new and see where the data is being copied wrong
This commit is contained in:
Kurt 2023-08-09 00:43:29 -07:00
parent a483bf9a24
commit d647f15f23

View file

@ -420,8 +420,8 @@ public sealed class Tile
const int pixels = TileWidth * TileHeight;
for (int i = 0; i < pixels; i++)
{
var index = (8 * (1 + (i / 8))) + (i & 7);
if (ColorChoices[^index] != tileColors[i])
var index = pixels - (8 * (1 + (i / 8))) + (i & 7);
if (ColorChoices[index] != tileColors[i])
return false;
}
@ -433,7 +433,8 @@ public sealed class Tile
const int pixels = TileWidth * TileHeight;
for (int i = 0; i < pixels; i++)
{
if (ColorChoices[^i] != tileColors[i])
var index = pixels - 1 - i;
if (ColorChoices[index] != tileColors[i])
return false;
}