Bollos00 / LibreMines

A Free/Libre and Open Source Software Qt based Minesweeper game available for GNU/Linux, FreeBSD and Windows systems.
https://bollos00.github.io/LibreMines/
GNU General Public License v3.0
78 stars 11 forks source link

window stop responing bugfix #62

Open WindowsKonon1337 opened 1 week ago

WindowsKonon1337 commented 1 week ago

solution for this issue

Bollos00 commented 1 week ago

Hello, thanks for this pull request. I understand your approach to solve the issue. Unfortunately the issue still happens, for instance, when starting a new game on a 8x8 board with 97% of the mines.

I was thinking of solving the issue on this method https://github.com/Bollos00/LibreMines/blob/9cf52ae171e9afbb1d58f22dfd3b4e3219cc90db/src/libreminesgameengine.cpp#L545

When the user clicks any cell, this method is triggered. The variable bFirst indicates wheter it is the first time the user is clicking on any cell. On there, it is calling vNewGame and being stuck because there is no way a cell may have all its neighbors free of mine if nMines > (iX*iY - 9).

So a solution in this, I believe, would be not call vNewGame given that condition.