Skip to content

Commit

Permalink
libcommon: Continued updating code dependent on recently deprecated f…
Browse files Browse the repository at this point in the history
…unctions
  • Loading branch information
danij-deng committed Jul 24, 2014
1 parent e251140 commit 223a456
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 7 deletions.
29 changes: 23 additions & 6 deletions doomsday/plugins/common/src/g_game.cpp
Expand Up @@ -1538,7 +1538,11 @@ static void runGameAction()
{
#if __JDOOM__
// Has the secret map been completed?
if(G_CurrentMapNumber() == 8 && (gameModeBits & (GM_DOOM|GM_DOOM_SHAREWARE|GM_DOOM_ULTIMATE)))
if((gameModeBits & (GM_DOOM|GM_DOOM_SHAREWARE|GM_DOOM_ULTIMATE)) &&
(::gameMapUri.path() == "E1M9" ||
::gameMapUri.path() == "E2M9" ||
::gameMapUri.path() == "E3M9" ||
::gameMapUri.path() == "E4M9"))

This comment has been minimized.

Copy link
@skyjake

skyjake Jul 25, 2014

Owner

Looks like regex matching would be beneficial in Uri?

This comment has been minimized.

Copy link
@danij-deng

danij-deng Jul 25, 2014

Author Collaborator

Possibly. However most of these will be transferred to MapInfo shortly, so these tests won't be present in this form after that.

{
for(int i = 0; i < MAXPLAYERS; ++i)
{
Expand Down Expand Up @@ -2023,7 +2027,12 @@ void G_PlayerReborn(int player)
p->weapons[WT_SECOND].owned = true;
p->ammo[AT_CRYSTAL].owned = 50;

if(G_CurrentMapNumber() == 8 || secret)
if(secret ||
(::gameMapUri.path() == "E1M9" ||
::gameMapUri.path() == "E2M9" ||
::gameMapUri.path() == "E3M9" ||
::gameMapUri.path() == "E4M9" ||
::gameMapUri.path() == "E5M9"))
{
p->didSecret = true;
}
Expand Down Expand Up @@ -2124,24 +2133,32 @@ byte G_Ruleset_RespawnMonsters()
dd_bool G_IfVictory()
{
#if __JDOOM64__
if(G_CurrentMapNumber() == 27)
if(::gameMapUri.path() == "MAP28")
{
return true;
}
#elif __JDOOM__
if(gameMode == doom_chex)
{
if(G_CurrentMapNumber() == 4)
if(::gameMapUri.path() == "MAP05")
{
return true;
}
}
else if((gameModeBits & GM_ANY_DOOM) && G_CurrentMapNumber() == 7)
else if((gameModeBits & GM_ANY_DOOM) &&
(::gameMapUri.path() == "E1M8" ||
::gameMapUri.path() == "E2M8" ||
::gameMapUri.path() == "E3M8" ||
::gameMapUri.path() == "E4M8"))
{
return true;
}
#elif __JHERETIC__
if(G_CurrentMapNumber() == 7)
if(::gameMapUri.path() == "E1M8" ||
::gameMapUri.path() == "E2M8" ||
::gameMapUri.path() == "E3M8" ||
::gameMapUri.path() == "E4M8" ||
::gameMapUri.path() == "E5M8")
{
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion doomsday/plugins/common/src/p_map.cpp
Expand Up @@ -168,7 +168,7 @@ static int PIT_StompThing(mobj_t *mo, void *context)
if(!Mobj_IsPlayer(parm.stompMobj)) return true;
#elif __JDOOM__
// Monsters only stomp on a boss map.
if(!Mobj_IsPlayer(parm.stompMobj) && G_CurrentMapNumber() != 29)
if(!Mobj_IsPlayer(parm.stompMobj) && ::gameMapUri.path() != "MAP30")
return true;
#endif
}
Expand Down

0 comments on commit 223a456

Please sign in to comment.