Error:
We check if player > m_TerritoryCellCounts.size(), but m_TerritoryCellCounts.size() == number of players and we use player as index
Plus we are recomputing territories after we check bounds what if we remove player can lead to out of bounds exception
Run Atlas in debug mode and lower number of players to 1 using arrow key or mouse wheel