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_Completed(P_TranslateMap(P_GetMapNextMap(gamemap)), 0); } } RunThinkers(); P_UpdateSpecials(); P_AnimateSurfaces(); leveltime++; }
void P_Ticker(void) { int i; if(paused) { return; } for(i = 0; i < MAXPLAYERS; i++) { //rww begin - added players[i].mo check if(playeringame[i] && players[i].mo) //rww end { P_PlayerThink(&players[i]); } } if(TimerGame) { if(!--TimerGame) { G_Completed(P_TranslateMap(P_GetMapNextMap(gamemap)), 0); } } RunThinkers(); P_UpdateSpecials(); P_AnimateSurfaces(); leveltime++; }
Word P_Ticker(void) { player_t *pl; /* wait for refresh to latch all needed data before */ /* running the next tick */ gameaction = ga_nothing; /* Game in progress */ Tick1 = FALSE; /* Reset the flags */ Tick2 = FALSE; Tick4 = FALSE; TimeMark1+=ElapsedTime; /* Timer for ticks */ TimeMark2+=ElapsedTime; TimeMark4+=ElapsedTime; if (TimeMark1>=TICKSPERSEC) { /* Now see if the time has passed... */ TimeMark1-=TICKSPERSEC; Tick1 = TRUE; } if (TimeMark2>=(TICKSPERSEC/2)) { TimeMark2-=(TICKSPERSEC/2); Tick2 = TRUE; } if (TimeMark4>=(TICKSPERSEC/4)) { TimeMark4-=(TICKSPERSEC/4); Tick4 = TRUE; } CheckCheats(); /* Handle pause and cheats */ /* Do option screen processing and control reading */ if (gamepaused) { /* If in pause mode, then don't do any game logic */ return gameaction; } /* Run player actions */ pl = &players; if (pl->playerstate == PST_REBORN) { /* Restart player? */ G_DoReborn(); /* Poof!! */ } AM_Control(pl); /* Handle automap controls */ O_Control(pl); /* Handle option controls */ P_PlayerThink(pl); /* Process player in the game */ if (!(players.AutomapFlags & AF_OPTIONSACTIVE)) { RunThinkers(); /* Handle logic for doors, walls etc... */ P_RunMobjBase(); /* Handle critter think logic */ } P_UpdateSpecials(); /* Handle wall and floor animations */ ST_Ticker(); /* Update status bar */ return gameaction; /* may have been set to ga_died, ga_completed, */ /* or ga_secretexit */ }