jonthysell / Mzinga

Open-source software to play the board game Hive.
MIT License
82 stars 9 forks source link

Index was outside the bounds of the array #109

Closed Natereater closed 3 years ago

Natereater commented 3 years ago

Any game in which a stack of beetles/mosquitos goes to maximum height I get this error:

"Index was outside of the bounds of the array"

Here is an example of me trying to open a file of a game from boardspace.net in which a high stack occurs:

System.IndexOutOfRangeException: Index was outside the bounds of the array. at Mzinga.Core.Board.GetPieceAt(Position& position, Direction direction) in D:\a\Mzinga\Mzinga\src\Mzinga\Core\Board.cs:line 1338 at Mzinga.Core.Board.IsOneHive() in D:\a\Mzinga\Mzinga\src\Mzinga\Core\Board.cs:line 1480 at Mzinga.Core.Board.CanMoveWithoutBreakingHive(PieceName pieceName) in D:\a\Mzinga\Mzinga\src\Mzinga\Core\Board.cs:line 1416 at Mzinga.Core.Board.GetValidMoves(PieceName pieceName, MoveSet moveSet) in D:\a\Mzinga\Mzinga\src\Mzinga\Core\Board.cs:line 786 at Mzinga.Core.Board.GetValidMoves() in D:\a\Mzinga\Mzinga\src\Mzinga\Core\Board.cs:line 180 at Mzinga.Viewer.GameRecording.LoadSGF(Stream inputStream, String fileName) in D:\a\Mzinga\Mzinga\src\Mzinga.Viewer\GameRecording.cs:line 394 at Mzinga.Viewer.MessageHandlers.ShowLoadGameAsync(LoadGameMessage message) in D:\a\Mzinga\Mzinga\src\Mzinga.Viewer\MessageHandlers.cs:line 211

jonthysell commented 3 years ago

Hi, this bug was fixed here: https://github.com/jonthysell/Mzinga/commit/5ef1c04da03709ae1fb6aff218e3e5bda51e36b4

Please update to Mzinga v11.3 or higher.