Skip to content

Commit

Permalink
savegame: bump version to version 3 for new music options (#913)
Browse files Browse the repository at this point in the history
  • Loading branch information
walkawayy authored Aug 11, 2023
1 parent 95478f3 commit 5b5c339
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/game/savegame.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ typedef enum SAVEGAME_VERSION {
VERSION_0 = 0,
VERSION_1 = 1,
VERSION_2 = 2,
VERSION_3 = 3,
} SAVEGAME_VERSION;

typedef enum SAVEGAME_FORMAT {
Expand Down
8 changes: 5 additions & 3 deletions src/game/savegame/savegame_bson.c
Original file line number Diff line number Diff line change
Expand Up @@ -1259,9 +1259,11 @@ bool Savegame_BSON_LoadFromFile(MYFILE *fp, GAME_INFO *game_info)
goto cleanup;
}

if (!SaveGame_BSON_LoadCurrentMusic(
json_object_get_object(root_obj, "music"))) {
goto cleanup;
if (header.version >= VERSION_3) {
if (!SaveGame_BSON_LoadCurrentMusic(
json_object_get_object(root_obj, "music"))) {
goto cleanup;
}
}

ret = true;
Expand Down

0 comments on commit 5b5c339

Please sign in to comment.