Commit 238c8f3f authored by Alexander Schuch's avatar Alexander Schuch
Browse files

Properly check for a valid selection in minimap.

Changing the dimensions of the map in game setup dialogue recreates the
game board. The sector selection is kept. However, the selection might
become invalid if the game board shrinks and the selection is not on the
board anymore. Adding a new player to the game will then result in
checking a sector outside the game board (NULL is returned), so that
a method is invoked on a NULL pointer, leading to a crash - see
NewGameDlg::slotNewOwner().

This is implemented in Konquest 2.1.

BUG: 329163
FIXED-IN: 4.11.5
parent 7a9b64c2
......@@ -41,7 +41,7 @@ public:
Coordinate selection() const { return m_selection; }
bool hasSelection() const { return m_selection != Coordinate(-1, -1); }
bool hasSelection() const { return (m_selection.x() >= 0) && (m_selection.x() < m_map->columns()) && (m_selection.y() >= 0) && (m_selection.y() < m_map->rows()); }
signals:
void sectorSelected(const Coordinate &coord);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment