Skip to content

Commit

Permalink
Continue save no longer overwritten when playing free level
Browse files Browse the repository at this point in the history
When you play a 'Free Play Level' or '1Player' level you can now use the 'Continue' button on the main menu to continue the campaign you played before.

Fixes bug #762
  • Loading branch information
Loobinex committed Sep 10, 2019
1 parent f92c2d7 commit 5256e62
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/frontend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1736,6 +1736,7 @@ short frontend_save_continue_game(short allow_lvnum_grow)
unsigned short victory_state;
short flg_mem;
LevelNumber lvnum;
lvnum = get_loaded_level_number();
SYNCDBG(6,"Starting");
player = get_my_player();
dungeon = get_players_dungeon(player);
Expand All @@ -1753,10 +1754,12 @@ short frontend_save_continue_game(short allow_lvnum_grow)
player->victory_state = victory_state;
memcpy(&dungeon->lvstats, scratch, sizeof(struct LevelStats));
set_flag_byte(&player->field_3,Pf3F_Unkn10,flg_mem);
// Only save continue if level was won, and not in packet mode
// Only save continue if level was won, not a free play level, not a multiplayer level and not in packet mode
if (((game.system_flags & GSF_NetworkActive) != 0)
|| ((game.operation_flags & GOF_SingleLevel) != 0)
|| (game.packet_load_enable))
|| (game.packet_load_enable)
|| (is_freeplay_level(lvnum))
|| (is_multiplayer_level(lvnum)))
return false;
// Select the continue level (move the campaign forward)
if ((allow_lvnum_grow) && (player->victory_state == VicS_WonLevel)) {
Expand Down
2 changes: 1 addition & 1 deletion version.mk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
VER_MAJOR=0
VER_MINOR=4
VER_RELEASE=6
VER_BUILD=1912
VER_BUILD=1913
PACKAGE_SUFFIX=unofficial

0 comments on commit 5256e62

Please sign in to comment.