mikxingu / HexMap_Editor

Unity Game about hexagonal map generation, edition and navigation. This repo has been discontinued and has become Read-Only. Head to the link below to get the last public version.
https://github.com/TechStrikeBrasil/HexMap-Revisited
Other
4 stars 1 forks source link

Array OutofBounds Exception #10

Closed mikxingu closed 4 years ago

mikxingu commented 4 years ago

After messing with the brush for a while on the corners of the map,you'll get a "IndexOutOfRangeException: Index was outside the bounds of the array.". I can't seem to know what is the problem. I already compared and refactored code but I still get this error message.

mikxingu commented 4 years ago

I found out that it's easier to reproduce this error when dragging the mouse through 2cells and then drag the mouse outside the border of the map. What could possibly be wrong?

mikxingu commented 4 years ago

Fixed the bug adjusting the HexGrid.cs file. The "GetCell" method that requires a position was returning an array index of cells. I fixed the bug returning coordinates of a cell.