Skip to content

Commit

Permalink
MenuBook: Fix books not closing properly when loading invalid file
Browse files Browse the repository at this point in the history
  • Loading branch information
dorkster committed Jan 1, 2025
1 parent 1ec0bfa commit 795e53c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions RELEASE_NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ Engine fixes:
* Fix being able to talk to NPC allies after they die.
* Prevent summons with zero base speed from teleporting with their summoner.
* The text for dialog options now respects the 'font_dialog' property in menus/talker.txt.
* Fixed books not closing properly when trying to load another book with an invalid filename.
* Android: Fix 'Flare' directory not being automatically created.
* Android: Added a dialog to direct the player to the wiki page for installing if no game data is found.

Expand Down
9 changes: 8 additions & 1 deletion src/MenuBook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ void MenuBook::loadBook() {

infile.close();
}
else {
closeWindow();
return;
}

refreshText();

Expand Down Expand Up @@ -335,6 +339,9 @@ void MenuBook::clearBook() {

delete event_close;
event_close = NULL;

delete background;
background = NULL;
}

void MenuBook::closeWindow() {
Expand Down Expand Up @@ -396,7 +403,7 @@ void MenuBook::logic() {
if (book_name.empty()) return;
else {
loadBook();
visible = true;
visible = book_loaded;
}

if (!visible)
Expand Down
2 changes: 1 addition & 1 deletion src/Version.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ FLARE. If not, see http://www.gnu.org/licenses/

#include <SDL.h>

Version VersionInfo::ENGINE(1, 14, 81);
Version VersionInfo::ENGINE(1, 14, 82);
Version VersionInfo::MIN(0, 0, 0);
Version VersionInfo::MAX(USHRT_MAX, USHRT_MAX, USHRT_MAX);

Expand Down

0 comments on commit 795e53c

Please sign in to comment.