Some minor tweaks to make countdown not COMPLETELY broken.

This commit is contained in:
toasterbabe 2017-07-04 14:58:58 +01:00
parent e5eb6720f0
commit 125646e521
4 changed files with 24 additions and 12 deletions

View file

@ -2499,6 +2499,7 @@ void G_DoReborn(INT32 playernum)
{
player_t *player = &players[playernum];
boolean resetlevel = false;
INT32 i;
if (modeattacking)
{
@ -2532,7 +2533,6 @@ void G_DoReborn(INT32 playernum)
resetlevel = true;
else if (gametype == GT_COOP && (netgame || multiplayer))
{
INT32 i;
if (cv_cooplives.value == 0)
;
else if (player->lives <= 0) // consider game over first
@ -2588,16 +2588,18 @@ void G_DoReborn(INT32 playernum)
// reload the level from scratch
if (countdowntimeup)
{
player->starpostangle = 0;
player->starposttime = 0;
player->starpostx = 0;
player->starposty = 0;
player->starpostz = 0;
player->starpostnum = 0;
for (i = 0; i < MAXPLAYERS; i++)
{
players[i].starpostangle = 0;
players[i].starposttime = 0;
players[i].starpostx = 0;
players[i].starposty = 0;
players[i].starpostz = 0;
players[i].starpostnum = 0;
}
}
if (!countdowntimeup && (mapheaderinfo[gamemap-1]->levelflags & LF_NORELOAD))
{
INT32 i;
player->playerstate = PST_REBORN;
P_LoadThingsOnly();
P_ClearStarPost(player->starpostnum);

View file

@ -2199,7 +2199,18 @@ static void P_LevelInitStuff(void)
// map time limit
if (mapheaderinfo[gamemap-1]->countdown)
{
tic_t maxtime = 0;
countdowntimer = mapheaderinfo[gamemap-1]->countdown * TICRATE;
for (i = 0; i < MAXPLAYERS; i++)
{
if (!playeringame[i])
continue;
if (players[i].starposttime > maxtime)
maxtime = players[i].starposttime;
}
countdowntimer -= maxtime;
}
else
countdowntimer = 0;
countdowntimeup = false;

View file

@ -650,7 +650,7 @@ void P_Ticker(boolean run)
if (run)
{
if (countdowntimer && --countdowntimer <= 0)
if (countdowntimer && G_PlatformGametype() && (gametype == GT_COOP || leveltime >= 4*TICRATE) && --countdowntimer <= 0)
{
countdowntimer = 0;
countdowntimeup = true;
@ -662,6 +662,8 @@ void P_Ticker(boolean run)
if (!players[i].mo)
continue;
if (multiplayer || netgame)
players[i].exiting = 0;
P_DamageMobj(players[i].mo, NULL, NULL, 1, DMG_INSTAKILL);
}
}

View file

@ -6690,9 +6690,6 @@ static void P_MovePlayer(player_t *player)
fixed_t runspd;
if (countdowntimeup)
return;
if (player->mo->state >= &states[S_PLAY_SUPER_TRANS] && player->mo->state <= &states[S_PLAY_SUPER_TRANS9])
{
player->mo->momx = player->mo->momy = player->mo->momz = 0;