mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-23 04:23:12 +00:00
Fix cgear skin import loop
byte 255->0 overflow infinite loop if too many tiles are unique https://projectpokemon.org/home/forums/topic/63828-c-gear-skin-editor-crash/?do=findComment&comment=285181
This commit is contained in:
parent
78e7536459
commit
0aa4a15851
1 changed files with 2 additions and 2 deletions
|
@ -231,12 +231,12 @@ public sealed class CGearBackground
|
||||||
private static void FindPossibleRotatedTile(Tile t, IList<Tile> tilelist, TileMap tm, int tileIndex)
|
private static void FindPossibleRotatedTile(Tile t, IList<Tile> tilelist, TileMap tm, int tileIndex)
|
||||||
{
|
{
|
||||||
// Test all tiles currently in the list
|
// Test all tiles currently in the list
|
||||||
for (byte i = 0; i < tilelist.Count; i++)
|
for (int i = 0; i < tilelist.Count; i++)
|
||||||
{
|
{
|
||||||
var rotVal = t.GetRotationValue(tilelist[i].ColorChoices);
|
var rotVal = t.GetRotationValue(tilelist[i].ColorChoices);
|
||||||
if (rotVal == Tile.ROTATION_BAD)
|
if (rotVal == Tile.ROTATION_BAD)
|
||||||
continue;
|
continue;
|
||||||
tm.TileChoices[tileIndex] = i;
|
tm.TileChoices[tileIndex] = (byte)i;
|
||||||
tm.Rotations[tileIndex] = rotVal;
|
tm.Rotations[tileIndex] = rotVal;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue