components/prboom/g_game.c
//
// G_InitNew
// Can be called by the startup code or the menu task,
// consoleplayer, displayplayer, playeringame[] should be set.
//
G_InitNew
Can be called by the startup code or the menu task,
consoleplayer, displayplayer, playeringame[] should be set.
G_InitNew Can be called by the startup code or the menu task consoleplayer displayplayer playeringame [] should be set .
void G_InitNew(skill_t skill, int episode, int map)
{
  int i;
  if (paused)
    {
      paused = false;
      S_ResumeSound();
    }
  if (skill > sk_nightmare)
    skill = sk_nightmare;
  if (episode < 1)
    episode = 1;
  if (gamemode == retail)
    {
      if (episode > 4)
        episode = 4;
    }
  else
    if (gamemode == shareware)
      {
        if (episode > 1)
          episode = 1; 
      }
    else
      if (episode > 3)
        episode = 3;
  if (map < 1)
    map = 1;
  if (map > 9 && gamemode != commercial)
    map = 9;
  G_SetFastParms(fastparm || skill == sk_nightmare);  
  M_ClearRandom();
  respawnmonsters = skill == sk_nightmare || respawnparm;
  for (i=0 ; i<MAXPLAYERS ; i++)
    players[i].playerstate = PST_REBORN;
  usergame = true;                
  paused = false;
  automapmode &= ~am_active;
  gameepisode = episode;
  gamemap = map;
  gameskill = skill;
  totalleveltimes = 0; 
  AM_clearMarks();
  G_DoLoadLevel ();
}
void G_InitNew ( skill_t skill , int episode , int map ) { int i ; if ( paused ) { paused = false ; S_ResumeSound ( ) ; } if ( skill > sk_nightmare ) skill = sk_nightmare ; if ( episode < 1 ) episode = 1 ; if ( gamemode == retail ) { if ( episode > 4 ) episode = 4 ; } else if ( gamemode == shareware ) { if ( episode > 1 ) episode = 1 ; } else if ( episode > 3 ) episode = 3 ; if ( map < 1 ) map = 1 ; if ( map > 9 && gamemode != commercial ) map = 9 ; G_SetFastParms ( fastparm || skill == sk_nightmare ) ; M_ClearRandom ( ) ; respawnmonsters = skill == sk_nightmare || respawnparm ; for ( i = 0 ; i < MAXPLAYERS ; i ++ ) players [ i ] . playerstate = PST_REBORN ; usergame = true ; paused = false ; automapmode &= ~ am_active ; gameepisode = episode ; gamemap = map ; gameskill = skill ; totalleveltimes = 0 ; AM_clearMarks ( ) ; G_DoLoadLevel ( ) ; }
G_InitNew
Can be called by the startup code or the menu task,
consoleplayer, displayplayer, playeringame[] should be set.
G_InitNew Can be called by the startup code or the menu task consoleplayer displayplayer playeringame [] should be set .
// only start episode 1 on shareware // killough 4/10/98 // force players to be initialized upon first level load // will be set false if a demo // cph //jff 4/16/98 force marks on automap cleared every new level start