Skip to content

Commit

Permalink
libcommon: Fix case sensitivity issues with map URIs (should not be)
Browse files Browse the repository at this point in the history
  • Loading branch information
danij-deng committed Jul 3, 2014
1 parent 9a9376b commit 7f40652
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions doomsday/plugins/common/src/g_game.cpp
Expand Up @@ -2340,7 +2340,7 @@ uint G_EpisodeNumberFor(de::Uri const &mapUri)
if(gameModeBits & (GM_ANY_DOOM | ~GM_DOOM_CHEX))
# endif
{
if(path.at(0) == 'E' && path.at(2) == 'M')
if(path.at(0).toLower() == 'e' && path.at(2).toLower() == 'm')
{
return path.substr(1, 1).toInt() - 1;
}
Expand All @@ -2363,13 +2363,13 @@ uint G_MapNumberFor(de::Uri const &mapUri)
if(gameModeBits & (GM_ANY_DOOM | ~GM_DOOM_CHEX))
# endif
{
if(path.at(0) == 'E' && path.at(2) == 'M')
if(path.at(0).toLower() == 'e' && path.at(2).toLower() == 'm')
{
return path.substr(3).toInt() - 1;
}
}
#endif
if(path.beginsWith("MAP"))
if(path.beginsWith("map", Qt::CaseInsensitive))
{
return path.substr(3).toInt() - 1;
}
Expand All @@ -2391,17 +2391,17 @@ de::Uri G_ComposeMapUri(uint episode, uint map)
{
de::String mapId;
#if __JDOOM64__
mapId = de::String("MAP%1").arg(map+1, 2, 10, QChar('0'));
mapId = de::String("map%1").arg(map+1, 2, 10, QChar('0'));
DENG2_UNUSED(episode);
#elif __JDOOM__
if(gameModeBits & GM_ANY_DOOM2)
mapId = de::String("MAP%1").arg(map+1, 2, 10, QChar('0'));
mapId = de::String("map%1").arg(map+1, 2, 10, QChar('0'));
else
mapId = de::String("E%1M%2").arg(episode+1).arg(map+1);
mapId = de::String("e%1m%2").arg(episode+1).arg(map+1);
#elif __JHERETIC__
mapId = de::String("E%1M%2").arg(episode+1).arg(map+1);
mapId = de::String("e%1m%2").arg(episode+1).arg(map+1);
#else
mapId = de::String("MAP%1").arg(map+1, 2, 10, QChar('0'));
mapId = de::String("map%1").arg(map+1, 2, 10, QChar('0'));
DENG2_UNUSED(episode);
#endif
return de::Uri("Maps", mapId);
Expand All @@ -2421,8 +2421,8 @@ uint G_NextMapNumber(dd_bool secretExit)
{
switch(map)
{
case 0: return 31;
case 3: return 28;
case 0: return 31;
case 3: return 28;
case 11: return 29;
case 17: return 30;
case 31: return 0;
Expand Down

0 comments on commit 7f40652

Please sign in to comment.