fix IndexOutOfRangeException in SNES Graphics Debugger #529

This commit is contained in:
zeromus 2015-10-24 18:04:35 -05:00
parent 855561ac19
commit 84be5d211c
1 changed files with 4 additions and 1 deletions

View File

@ -1163,7 +1163,10 @@ namespace BizHawk.Client.EmuHawk
if (bg.TileSize == 16) { tx /= 2; ty /= 2; } //worry about this later. need to pass a different flag into `currViewingTile`
int tloc = ty * bg.ScreenSizeInTiles.Width + tx;
if (tloc > map.Length) break;
if (tx >= bg.ScreenSizeInTiles.Width) break;
if (ty >= bg.ScreenSizeInTiles.Height) break;
if (tx < 0) break;
if (ty < 0) break;
currMapEntryState = new MapEntryState();
currMapEntryState.bgnum = (int)CurrDisplaySelection;