From: Holger Schemel Date: Sat, 8 Sep 2018 22:07:47 +0000 (+0200) Subject: fixed bug with displaying the wrong level number in the game panel X-Git-Tag: 4.1.1.0~41 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=8782186c774fb084a267151c05dc444cffab4b3d;p=rocksndiamonds.git fixed bug with displaying the wrong level number in the game panel When introducing a global levelset identifier and level number (see commit b7fe72dc), the level number to be displayed on the game panel was updated in the main menu and for network games, but not when selecting another level from the main menu or when automatically playing the next level after solving a level (and skipping the main menu before starting the next level), which results in displaying the wrong level number in the game panel in many cases. This was fixed now by updating the level number when loading the level from the level file (moving the function to update the level number to be displayed from the main menu to the function to load the level). --- diff --git a/src/files.c b/src/files.c index 21bede9a..266ef708 100644 --- a/src/files.c +++ b/src/files.c @@ -6648,6 +6648,8 @@ static void LoadLevel_LoadAndInit(struct LevelFileInfo *lfi_network_template) void LoadLevel(int nr) { + SetLevelSetInfo(leveldir_current->identifier, nr); + setLevelFileInfo(&level.file_info, nr); LoadLevel_LoadAndInit(NULL); diff --git a/src/screens.c b/src/screens.c index 4ee8179d..337bd565 100644 --- a/src/screens.c +++ b/src/screens.c @@ -1591,8 +1591,6 @@ void DrawMainMenu() init_last = init; /* switch to new busy animation */ - SetLevelSetInfo(leveldir_current->identifier, level_nr); - /* needed if last screen (level choice) changed graphics, sounds or music */ ReloadCustomArtwork(0);