Skip to content

Commit

Permalink
don't autoload from doom-all for unknown IWADs (#2208)
Browse files Browse the repository at this point in the history
  • Loading branch information
rfomin authored Feb 19, 2025
1 parent e3d74f9 commit 926c90b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
4 changes: 3 additions & 1 deletion src/d_iwad.c
Original file line number Diff line number Diff line change
Expand Up @@ -854,9 +854,11 @@ void D_GetModeAndMissionByIWADName(const char *name, GameMode_t *mode,
{
*mode = iwads[i].mode;
*mission = iwads[i].mission;
break;
return;
}
}
*mode = indetermined;
*mission = none;
}

const char *D_GetIWADDescription(const char *name, GameMode_t mode,
Expand Down
13 changes: 9 additions & 4 deletions src/d_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1347,22 +1347,27 @@ static void LoadIWadBase(void)
{
GameMode_t local_gamemode;
GameMission_t local_gamemission;
D_GetModeAndMissionByIWADName(M_BaseName(wadfiles[0]), &local_gamemode, &local_gamemission);
D_GetModeAndMissionByIWADName(M_BaseName(wadfiles[0]), &local_gamemode,
&local_gamemission);

if (local_gamemission == none || local_gamemode == indetermined)
{
return;
}

if (local_gamemission < pack_chex)
{
W_AddBaseDir("doom-all");
}
else if (local_gamemission == pack_chex || local_gamemission == pack_chex3v)
if (local_gamemission == pack_chex || local_gamemission == pack_chex3v)
{
W_AddBaseDir("chex-all");
}
if (local_gamemission == doom)
{
W_AddBaseDir("doom1-all");
}
else if (local_gamemission >= doom2
&& local_gamemission <= pack_plut)
else if (local_gamemission >= doom2 && local_gamemission <= pack_plut)
{
W_AddBaseDir("doom2-all");
}
Expand Down

0 comments on commit 926c90b

Please sign in to comment.