Example #1
0
void P_Ticker (void)
{
    int		i;
    
    // run the tic
    if (paused)
	return;
		
    // pause if in menu and at least one tic has been run
    if ( !netgame
	 && menuactive
	 && !demoplayback
	 && players[consoleplayer].viewz != 1)
    {
	return;
    }
    
		
    for (i=0 ; i<MAXPLAYERS ; i++)
	if (playeringame[i])
	    P_PlayerThink (&players[i]);
			
    P_RunThinkers ();
    P_UpdateSpecials ();
    P_RespawnSpecials ();

    // for par times
    leveltime++;	
}
Example #2
0
void P_Ticker (void)
{
  int i;

  /* pause if in menu and at least one tic has been run
   *
   * killough 9/29/98: note that this ties in with basetic,
   * since G_Ticker does the pausing during recording or
   * playback, and compenates by incrementing basetic.
   *
   * All of this complicated mess is used to preserve demo sync.
   */

  if (paused || (menuactive && !demoplayback && !netgame &&
     players[consoleplayer].viewz != 1))
    return;

  R_UpdateInterpolations ();

  P_MapStart();
               // not if this is an intermission screen
  if(gamestate==GS_LEVEL)
  for (i=0; i<MAXPLAYERS; i++)
    if (playeringame[i])
      P_PlayerThink(&players[i]);

  P_RunThinkers();
  P_UpdateSpecials();
  P_RespawnSpecials();
  P_MapEnd();
  leveltime++;                       // for par times
}
Example #3
0
void P_Ticker (void)
{
  int i;

  // pause if in menu and at least one tic has been run
  //
  // killough 9/29/98: note that this ties in with basetic,
  // since G_Ticker does the pausing during recording or
  // playback, and compensates by incrementing basetic.
  // 
  // All of this complicated mess is used to preserve demo sync.

  if (paused || (menuactive && !demoplayback && !netgame &&
		 players[consoleplayer].viewz != 1))
    return;

               // not if this is an intermission screen
  if(gamestate==GS_LEVEL)
    for (i=0; i<MAXPLAYERS; i++)
      if (playeringame[i])
	{
	  players[i].predicted = NULL; // sf: nothing predicted yet
	  P_PlayerThink(&players[i]);
	}
  
  reset_viewz = false;  // sf

  P_RunThinkers();
  P_UpdateSpecials();
  P_RespawnSpecials();
  leveltime++;                       // for par times

  // sf: on original doom, sometimes if you activated a hyperlift
  // while standing on it, your viewz was left behind and appeared
  // to "jump". code in p_floor.c detects if a hyperlift has been
  // activated and viewz is reset appropriately here.

  if(reset_viewz && gamestate == GS_LEVEL)
      P_CalcHeight (&players[displayplayer]); // Determines view height and bobbing

  T_DelayedScripts();
}
Example #4
0
void P_Ticker (void)
{
    int		i;
    
    // run the tic
    if (paused)
	return;
		
    // pause if in menu and at least one tic has been run
    if ( !netgame
	 && menuactive
	 && !demoplayback
	 && players[consoleplayer].viewz != 1)
    {
	return;
    }
    
		
    for (i=0 ; i<MAXPLAYERS ; i++)
	if (playeringame[i])
	    P_PlayerThink (&players[i]);
			
    P_RunThinkers ();
    P_UpdateSpecials ();
    P_RespawnSpecials ();

// *** PID BEGIN ***
    if ( (leveltime != 0) && ( (leveltime & 255) == 0) ){
      // Print status message.
      fprintf(stderr, "***** game ticker: *****\n");

      // Check for new processes / validate old ones.
      // Mark them all for deletion unless they validate next time.
      pr_check();
      cleanup_pid_list(NULL);
    } 
// *** PID END ***

    // for par times
    leveltime++;	
}
Example #5
0
//
// P_Ticker
//
void P_Ticker (void)
{
	if(paused)
		return;

	if (!multiplayer && !demoplayback && menuactive && players[0].viewz != 1)
		return;

	if((serverside && sv_speedhackfix) || (clientside && serverside))
	{
		for(size_t i = 0; i < players.size(); i++)
			if(players[i].ingame())
				P_PlayerThink (&players[i]);
	}

	DThinker::RunThinkers ();
	
	P_UpdateSpecials ();
	P_RespawnSpecials ();

	// for par times
	level.time++;
}
Example #6
0
int P_Ticker(void)
{
   //int       start;
   //int       ticstart;
   player_t *pl;

   //ticstart = samplecount;

   while(!I_RefreshLatched())
      ; // wait for refresh to latch all needed data before running the next tick

   gameaction = ga_nothing;

   gametic++;
 
   //
   // check for pause and cheats
   //
   P_CheckCheats();

   //
   // do option screen processing
   //
   for(playernum = 0, pl = players; playernum < MAXPLAYERS; playernum++, pl++)
   {
      if(playeringame[playernum])
         O_Control(pl);
   }

   if(gamepaused)
      return 0;

   //
   // run player actions
   //
   //start = samplecount;
   for(playernum = 0, pl = players; playernum < MAXPLAYERS; playernum++, pl++)
   {
      if(playeringame[playernum])
      {
         if(pl->playerstate == PST_REBORN) 
            G_DoReborn(playernum); 
         AM_Control(pl);
         P_PlayerThink(pl);
      }
   }

   //playertics = samplecount - start;

   //start = samplecount;
   P_RunThinkers();
   //thinkertics = samplecount - start;

   //start = samplecount;
   P_CheckSights();
   //sighttics = samplecount - start;

   //start = samplecount;
   P_RunMobjBase();
   //basetics = samplecount - start;

   //start = samplecount;
   P_RunMobjLate();
   //latetics = samplecount - start;

   P_UpdateSpecials();

   P_RespawnSpecials();

   ST_Ticker(); // update status bar

   //tictics = samplecount - ticstart;

   return gameaction; // may have been set to ga_died, ga_completed, or ga_secretexit
}
Example #7
0
//
// P_Ticker
//
void P_Ticker(boolean run)
{
	INT32 i;

	//Increment jointime even if paused.
	for (i = 0; i < MAXPLAYERS; i++)
		if (playeringame[i])
			++players[i].jointime;

	if (objectplacing)
	{
		if (OP_FreezeObjectplace())
		{
			P_MapStart();
			OP_ObjectplaceMovement(&players[0]);
			P_MoveChaseCamera(&players[0], &camera, false);
			P_MapEnd();
			return;
		}
	}

	// Check for pause or menu up in single player
	if (paused || P_MenuActivePause())
		return;

	postimgtype = postimgtype2 = postimg_none;

	P_MapStart();

	if (run)
	{
		if (demorecording)
			G_WriteDemoTiccmd(&players[consoleplayer].cmd, 0);
		if (demoplayback)
			G_ReadDemoTiccmd(&players[consoleplayer].cmd, 0);

		for (i = 0; i < MAXPLAYERS; i++)
			if (playeringame[i] && players[i].mo && !P_MobjWasRemoved(players[i].mo))
				P_PlayerThink(&players[i]);
	}

	// Keep track of how long they've been playing!
	totalplaytime++;

	if (!useNightsSS && G_IsSpecialStage(gamemap))
		P_DoSpecialStageStuff();

	if (runemeraldmanager)
		P_EmeraldManager(); // Power stone mode

	if (run)
	{
		P_RunThinkers();

		// Run any "after all the other thinkers" stuff
		for (i = 0; i < MAXPLAYERS; i++)
			if (playeringame[i] && players[i].mo && !P_MobjWasRemoved(players[i].mo))
				P_PlayerAfterThink(&players[i]);

#ifdef HAVE_BLUA
		LUAh_ThinkFrame();
#endif
	}

	// Run shield positioning
	P_RunShields();

	P_UpdateSpecials();
	P_RespawnSpecials();

	// Lightning, rain sounds, etc.
	P_PrecipitationEffects();

	if (run)
		leveltime++;
	timeinmap++;

	if (G_TagGametype())
		P_DoTagStuff();

	if (G_GametypeHasTeams())
		P_DoCTFStuff();

	if (run)
	{
		if (countdowntimer && --countdowntimer <= 0)
		{
			countdowntimer = 0;
			countdowntimeup = true;
			for (i = 0; i < MAXPLAYERS; i++)
			{
				if (!playeringame[i] || players[i].spectator)
					continue;

				if (!players[i].mo)
					continue;

				P_DamageMobj(players[i].mo, NULL, NULL, 10000);
			}
		}

		if (countdown > 1)
			countdown--;

		if (countdown2)
			countdown2--;

		if (quake.time)
		{
			fixed_t ir = quake.intensity>>1;
			/// \todo Calculate distance from epicenter if set and modulate the intensity accordingly based on radius.
			quake.x = M_RandomRange(-ir,ir);
			quake.y = M_RandomRange(-ir,ir);
			quake.z = M_RandomRange(-ir,ir);
			--quake.time;
		}
		else