void P_Ticker(void) { int i; if (paused) { return; } for (i = 0; i < MAXPLAYERS; i++) { if (playeringame[i]) { P_PlayerThink(&players[i]); } } if (TimerGame) { if (!--TimerGame) { G_ExitLevel(); } } P_RunThinkers(); P_UpdateSpecials(); P_AmbientSound(); leveltime++; }
/** * Called 35 times per second. * The heart of play sim. */ void P_DoTick(void) { int i; Pause_Ticker(); // If the game is paused, nothing will happen. if(paused) return; actualMapTime++; if(!IS_CLIENT && timerGame && !paused) { if(!--timerGame) { G_LeaveMap(G_GetNextMap(gameEpisode, gameMap, false), 0, false); } } // Pause if in menu and at least one tic has been run. if(!IS_NETGAME && (Hu_MenuIsActive() || Hu_IsMessageActive()) && !Get(DD_PLAYBACK) && mapTime > 1) return; Thinker_Run(); #if __JDOOM__ || __JDOOM64__ || __JHERETIC__ // Extended lines and sectors. XG_Ticker(); #endif #if __JHEXEN__ P_AnimateSky(); P_AnimateLightning(); #endif #if __JDOOM64__ P_ThunderSector(); #endif P_ProcessDeferredSpawns(); #if __JHERETIC__ P_AmbientSound(); #endif // Let the engine know where the local players are now. for(i = 0; i < MAXPLAYERS; ++i) { R_UpdateConsoleView(i); } // For par times, among other things. mapTime++; }