Crash in grid.hpp - vector subscript is out of range
StevenJAckerman opened this issue · 1 comments
StevenJAckerman commented
Running latest release, conf.txt file attached, using release map.png
Cells vector subscript is out of range in this function:
const T& getCst(sf::Vector2i cell_coord) const
{
return cells[getIndexFromCoords(cell_coord)];
}
cell_coord.x = 207, cell_coord.y = 270, cells.size = 129600
In the called function, width = 480:
uint64_t getIndexFromCoords(const sf::Vector2i& cell_coords) const
{
return cell_coords.x + cell_coords.y * width;
}
So this returns 207 + (270 * 480) = 129807 which is out of range.
johnBuffer commented
Thanks, I did push a fix, it should be fine now