Skip to content

Commit

Permalink
stats tracking: Don't separate TNT31.WAD from TNT.WAD
Browse files Browse the repository at this point in the history
  • Loading branch information
xemonix0 committed Nov 3, 2024
1 parent 546e09d commit 16e0933
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Merged changes from [Nugget Doom 3.3.0](https://github.com/MrAlaux/Nugget-Doom/r
- Minor improvements to rocket smoke physics have been introduced
- _Detection of Targets in Darkness_ now accounts for fullbright frames
- WAD stats are now saved every time a level is beaten
- `TNT31.WAD` is now not considered a separate WAD by the _stats tracking_ system when loaded with `TNT.WAD`

## Bug Fixes

Expand Down
19 changes: 18 additions & 1 deletion src/wad_stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@ static char **DataDirNames(void)
}

const char *filename = M_BaseName(wadfiles[i].name);

// Do not separate the official TNT MAP31 fix from the base game
if (gamemission == pack_tnt && !strncasecmp(filename, "TNT31.WAD", 9))
{
continue;
}

size_t length = strlen(filename) - 3;
char *name = malloc(length);
M_StringCopy(name, filename, length);
Expand Down Expand Up @@ -237,14 +244,24 @@ static void CreateStats(boolean finish)
for (int i = numlumps - 1; i > 0; --i)
{
const char *lump_name = lumpinfo[i].name;
if (lumpinfo[i].source == source_other
const wad_source_t source = lumpinfo[i].source;
if (source == source_other
|| !MN_StartsWithMapIdentifier(lumpinfo[i].name)
|| MapStatsExist(lump_name))
{
continue;
}

char *wad_name = M_StringDuplicate(W_WadNameForLump(i));

// Do not separate the official TNT MAP31 fix from the base game
if (source == source_pwad && gamemission == pack_tnt
&& !strncasecmp(wad_name, "TNT31.WAD", 9))
{
free(wad_name);
continue;
}

if (!last_wad_name || strcmp(last_wad_name, wad_name))
{
last_wad_name = M_StringDuplicate(wad_name);
Expand Down

0 comments on commit 16e0933

Please sign in to comment.