Skip to content

Commit

Permalink
Fixed|Doom: Inconsistent games IDs
Browse files Browse the repository at this point in the history
Freedoom and BFG variants of Doom 1 sould also use the “doom1-“ identifier.
  • Loading branch information
skyjake committed Nov 9, 2018
1 parent af6df1a commit a00d371
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion doomsday/apps/libdoomsday/src/games.cpp
Expand Up @@ -115,6 +115,12 @@ DENG2_PIMPL(Games)

Game *findById(String id) const
{
if (id.beginsWith("doom-"))
{
// Originally, Freedoom and BFG variants used an inconsistently named ID.
id = "doom1-" + id.substr(5);
}

auto found = idLookup.constFind(id.toLower());
if (found != idLookup.constEnd())
{
Expand Down Expand Up @@ -188,7 +194,7 @@ GameProfile const *Games::firstPlayable() const
return nullptr;
}

Game &Games::operator [] (String const &id) const
Game &Games::operator[](String const &id) const
{
if (id.isEmpty()) return *d->nullGame;

Expand Down
4 changes: 2 additions & 2 deletions doomsday/apps/plugins/doom/src/d_api.cpp
Expand Up @@ -66,8 +66,8 @@ static char const *gameIds[NUM_GAME_MODES] =
"hacx",
"doom2-freedm",
"doom2-freedoom",
"doom-freedoom",
"doom-bfg",
"doom1-freedoom",
"doom1-bfg",
"doom2-bfg",
"doom2-nerve",
};
Expand Down

0 comments on commit a00d371

Please sign in to comment.