From 9a8ee00aec0311645918cadcb7e04b9e2ca2d06d Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 27 Jul 2021 22:07:16 +0200 Subject: [PATCH] - set currentLevel before calling engineLoadBoard. This is needed if the compatibility patcher needs to alter mapinfo data. --- source/games/duke/src/premap.cpp | 2 +- source/games/sw/src/game.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/games/duke/src/premap.cpp b/source/games/duke/src/premap.cpp index 2e1193b03..0d9781deb 100644 --- a/source/games/duke/src/premap.cpp +++ b/source/games/duke/src/premap.cpp @@ -944,9 +944,9 @@ static int LoadTheMap(MapRecord *mi, struct player_struct *p, int gamemode) I_Error("Cannot load user maps with shareware version!\n"); } + currentLevel = mi; engineLoadBoard(mi->fileName, isShareware(), &p->pos, &lbang, &p->cursectnum); - currentLevel = mi; SECRET_SetMapName(mi->DisplayName(), mi->name); STAT_NewLevel(mi->fileName); diff --git a/source/games/sw/src/game.cpp b/source/games/sw/src/game.cpp index fb27a714e..e2de44aca 100644 --- a/source/games/sw/src/game.cpp +++ b/source/games/sw/src/game.cpp @@ -321,8 +321,8 @@ void InitLevel(MapRecord *maprec) } int16_t ang; - engineLoadBoard(maprec->fileName, SW_SHAREWARE ? 1 : 0, &Player[0].pos, &ang, &Player[0].cursectnum); currentLevel = maprec; + engineLoadBoard(maprec->fileName, SW_SHAREWARE ? 1 : 0, &Player[0].pos, &ang, &Player[0].cursectnum); SECRET_SetMapName(currentLevel->DisplayName(), currentLevel->name); STAT_NewLevel(currentLevel->fileName);