Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…2855082&group_id=74815&atid=542099]

Fixed (Hexen): cvar "msg-hub-override", did not work.
  • Loading branch information
danij-deng committed Nov 13, 2009
1 parent ef9b11b commit ee0dd10
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 21 deletions.
9 changes: 2 additions & 7 deletions doomsday/plugins/common/src/f_infine.c
Expand Up @@ -763,13 +763,8 @@ int FI_Briefing(int episode, int map)
*/
int FI_Debriefing(int episode, int map)
{
char mid[20];
ddfinale_t fin;

// If we're already in the INFINE state, don't start a finale.
if(briefDisabled || G_GetGameState() == GS_INFINE || IS_CLIENT ||
Get(DD_PLAYBACK))
return false;
char mid[20];
ddfinale_t fin;

// Is there such a finale definition?
P_GetMapLumpName(episode, map, mid);
Expand Down
25 changes: 23 additions & 2 deletions doomsday/plugins/common/src/g_game.c
Expand Up @@ -1903,6 +1903,22 @@ void G_PrepareWIData(void)
}
#endif

boolean G_DebriefingEnabled(void)
{
// If we're already in the INFINE state, don't start a finale.
if(briefDisabled)
return false;
#if __JHEXEN__
if(cfg.overrideHubMsg && G_GetGameState() == GS_MAP &&
P_GetMapCluster(gameMap) != P_GetMapCluster(leaveMap))
return false;
#endif
if(G_GetGameState() == GS_INFINE || IS_CLIENT || Get(DD_PLAYBACK))
return false;

return true;
}

void G_WorldDone(void)
{
#if __JDOOM__ || __JDOOM64__
Expand All @@ -1911,14 +1927,19 @@ void G_WorldDone(void)
#endif

// Clear the currently playing script, if any.
// @note FI_Reset() changes the game state so we must determine
// whether the debrief is enabled first.
{
boolean doDebrief = G_DebriefingEnabled();

FI_Reset();

// Is there a debriefing for this map?
if(FI_Debriefing(gameEpisode, gameMap))
if(doDebrief && FI_Debriefing(gameEpisode, gameMap))
return;

// We have either just returned from a debriefing or there wasn't one.
briefDisabled = false;
}

G_SetGameAction(GA_LEAVEMAP);
}
Expand Down
6 changes: 4 additions & 2 deletions doomsday/plugins/jdoom/src/m_cheat.c
Expand Up @@ -335,13 +335,15 @@ int Cht_WarpFunc(const int* args, int player)
if(!G_ValidateMap(&epsd, &map))
return false;

// So be it.
P_SetMessage(plr, STSTR_CLEV, false);
G_DeferedInitNew(gameSkill, epsd, map);

// Clear the menu if open.
Hu_MenuCommand(MCMD_CLOSE);

// So be it.
briefDisabled = true;
G_DeferedInitNew(gameSkill, epsd, map);

return true;
}

Expand Down
6 changes: 4 additions & 2 deletions doomsday/plugins/jdoom64/src/m_cheat.c
Expand Up @@ -163,13 +163,15 @@ boolean Cht_WarpFunc(player_t* plr, cheatseq_t* cheat)
if(!G_ValidateMap(&epsd, &map))
return false;

// So be it.
P_SetMessage(plr, STSTR_CLEV, false);
G_DeferedInitNew(gameSkill, epsd, map);

// Clear the menu if open.
Hu_MenuCommand(MCMD_CLOSE);

// So be it.
briefDisabled = true;
G_DeferedInitNew(gameSkill, epsd, map);

return true;
}

Expand Down
7 changes: 4 additions & 3 deletions doomsday/plugins/jheretic/src/m_cheat.c
Expand Up @@ -332,15 +332,16 @@ int Cht_WarpFunc(const int* args, int player)
if(!G_ValidateMap(&epsd, &map))
return false;

// So be it.
P_SetMessage(plr, TXT_CHEATWARP, false);
S_LocalSound(SFX_DORCLS, NULL);

G_DeferedInitNew(gameSkill, epsd, map);

// Clear the menu if open.
Hu_MenuCommand(MCMD_CLOSE);

// So be it.
briefDisabled = true;
G_DeferedInitNew(gameSkill, epsd, map);

return true;
}

Expand Down
12 changes: 7 additions & 5 deletions doomsday/plugins/jhexen/src/m_cheat.c
Expand Up @@ -401,16 +401,18 @@ int Cht_WarpFunc(const int* args, int player)
return false;
}

// So be it.
P_SetMessage(plr, TXT_CHEATWARP, false);
S_LocalSound(SFX_PLATFORM_STOP, NULL);
leaveMap = map;
leavePosition = 0;
G_WorldDone();
P_SetMessage(plr, TXT_CHEATWARP, false);

// Clear the menu if open.
Hu_MenuCommand(MCMD_CLOSE);

// So be it.
leaveMap = map;
leavePosition = 0;
briefDisabled = true;
G_WorldDone();

return true;
}

Expand Down

0 comments on commit ee0dd10

Please sign in to comment.