diff --git a/source/blood/src/blood.cpp b/source/blood/src/blood.cpp index 626ab74a8..be0f0327b 100644 --- a/source/blood/src/blood.cpp +++ b/source/blood/src/blood.cpp @@ -70,6 +70,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "gameconfigfile.h" #include "gamecontrol.h" #include "m_argv.h" +#include "statistics.h" #ifdef _WIN32 # include @@ -480,6 +481,7 @@ int16_t startang, startsectnum; void StartLevel(GAMEOPTIONS *gameOptions) { + STAT_Update(0); EndLevel(); gStartNewGame = 0; ready2send = 0; @@ -545,6 +547,7 @@ void StartLevel(GAMEOPTIONS *gameOptions) return; } char levelName[BMAX_PATH]; + STAT_NewLevel(gameOptions->zLevelName); G_LoadMapHack(levelName, gameOptions->zLevelName); wsrand(gameOptions->uMapCRC); gKillMgr.Clear(); @@ -1469,8 +1472,11 @@ RESTART: // gStartNewGame = 0; // gQuitGame = 1; //} - if (gStartNewGame) - StartLevel(&gGameOptions); + if (gStartNewGame) + { + STAT_StartNewGame(gEpisodeInfo[gGameOptions.nEpisode].at0, gGameOptions.nDifficulty); + StartLevel(&gGameOptions); + } } ready2send = 0; if (gDemo.at0) diff --git a/source/blood/src/endgame.cpp b/source/blood/src/endgame.cpp index b106836d9..c69e0dd69 100644 --- a/source/blood/src/endgame.cpp +++ b/source/blood/src/endgame.cpp @@ -39,6 +39,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "sound.h" #include "view.h" #include "messages.h" +#include "statistics.h" BEGIN_BLD_NS @@ -101,6 +102,7 @@ void CEndGameMgr::Setup(void) at1 = gInputMode; gInputMode = kInputEndGame; at0 = 1; + STAT_Update(true); EndLevel(); sndStartSample(268, 128, -1, 1); inputState.keyFlushScans(); diff --git a/source/common/statistics.cpp b/source/common/statistics.cpp index 24ac130a2..2619bc42d 100644 --- a/source/common/statistics.cpp +++ b/source/common/statistics.cpp @@ -354,6 +354,7 @@ void STAT_StartNewGame(const char *episode, int skill) strncpy(StartEpisode, episode, MAX_PATH); StartSkill = skill; LevelData.Clear(); + *LevelName = 0; } void STAT_NewLevel(const char* mapname) @@ -397,7 +398,7 @@ static void StoreLevelStats() void STAT_Update(bool endofgame) { - if (*StartEpisode == 0) return; + if (*StartEpisode == 0 || *LevelName == 0) return; const char* fn = "?"; // record the current level's stats. StoreLevelStats(); diff --git a/source/duke3d/src/game.cpp b/source/duke3d/src/game.cpp index 15d32d993..1166e5b36 100644 --- a/source/duke3d/src/game.cpp +++ b/source/duke3d/src/game.cpp @@ -44,7 +44,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "gameconfigfile.h" #include "printf.h" #include "m_argv.h" -#include "filesystem.h" +#include "filesystem/filesystem.h" #include "statistics.h" // Uncomment to prevent anything except mirrors from drawing. It is sensible to