Some minor tweaks to make countdown not COMPLETELY broken.
This commit is contained in:
parent
e5eb6720f0
commit
125646e521
18
src/g_game.c
18
src/g_game.c
|
@ -2499,6 +2499,7 @@ void G_DoReborn(INT32 playernum)
|
||||||
{
|
{
|
||||||
player_t *player = &players[playernum];
|
player_t *player = &players[playernum];
|
||||||
boolean resetlevel = false;
|
boolean resetlevel = false;
|
||||||
|
INT32 i;
|
||||||
|
|
||||||
if (modeattacking)
|
if (modeattacking)
|
||||||
{
|
{
|
||||||
|
@ -2532,7 +2533,6 @@ void G_DoReborn(INT32 playernum)
|
||||||
resetlevel = true;
|
resetlevel = true;
|
||||||
else if (gametype == GT_COOP && (netgame || multiplayer))
|
else if (gametype == GT_COOP && (netgame || multiplayer))
|
||||||
{
|
{
|
||||||
INT32 i;
|
|
||||||
if (cv_cooplives.value == 0)
|
if (cv_cooplives.value == 0)
|
||||||
;
|
;
|
||||||
else if (player->lives <= 0) // consider game over first
|
else if (player->lives <= 0) // consider game over first
|
||||||
|
@ -2588,16 +2588,18 @@ void G_DoReborn(INT32 playernum)
|
||||||
// reload the level from scratch
|
// reload the level from scratch
|
||||||
if (countdowntimeup)
|
if (countdowntimeup)
|
||||||
{
|
{
|
||||||
player->starpostangle = 0;
|
for (i = 0; i < MAXPLAYERS; i++)
|
||||||
player->starposttime = 0;
|
{
|
||||||
player->starpostx = 0;
|
players[i].starpostangle = 0;
|
||||||
player->starposty = 0;
|
players[i].starposttime = 0;
|
||||||
player->starpostz = 0;
|
players[i].starpostx = 0;
|
||||||
player->starpostnum = 0;
|
players[i].starposty = 0;
|
||||||
|
players[i].starpostz = 0;
|
||||||
|
players[i].starpostnum = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!countdowntimeup && (mapheaderinfo[gamemap-1]->levelflags & LF_NORELOAD))
|
if (!countdowntimeup && (mapheaderinfo[gamemap-1]->levelflags & LF_NORELOAD))
|
||||||
{
|
{
|
||||||
INT32 i;
|
|
||||||
player->playerstate = PST_REBORN;
|
player->playerstate = PST_REBORN;
|
||||||
P_LoadThingsOnly();
|
P_LoadThingsOnly();
|
||||||
P_ClearStarPost(player->starpostnum);
|
P_ClearStarPost(player->starpostnum);
|
||||||
|
|
|
@ -2199,7 +2199,18 @@ static void P_LevelInitStuff(void)
|
||||||
|
|
||||||
// map time limit
|
// map time limit
|
||||||
if (mapheaderinfo[gamemap-1]->countdown)
|
if (mapheaderinfo[gamemap-1]->countdown)
|
||||||
|
{
|
||||||
|
tic_t maxtime = 0;
|
||||||
countdowntimer = mapheaderinfo[gamemap-1]->countdown * TICRATE;
|
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
|
else
|
||||||
countdowntimer = 0;
|
countdowntimer = 0;
|
||||||
countdowntimeup = false;
|
countdowntimeup = false;
|
||||||
|
|
|
@ -650,7 +650,7 @@ void P_Ticker(boolean run)
|
||||||
|
|
||||||
if (run)
|
if (run)
|
||||||
{
|
{
|
||||||
if (countdowntimer && --countdowntimer <= 0)
|
if (countdowntimer && G_PlatformGametype() && (gametype == GT_COOP || leveltime >= 4*TICRATE) && --countdowntimer <= 0)
|
||||||
{
|
{
|
||||||
countdowntimer = 0;
|
countdowntimer = 0;
|
||||||
countdowntimeup = true;
|
countdowntimeup = true;
|
||||||
|
@ -662,6 +662,8 @@ void P_Ticker(boolean run)
|
||||||
if (!players[i].mo)
|
if (!players[i].mo)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (multiplayer || netgame)
|
||||||
|
players[i].exiting = 0;
|
||||||
P_DamageMobj(players[i].mo, NULL, NULL, 1, DMG_INSTAKILL);
|
P_DamageMobj(players[i].mo, NULL, NULL, 1, DMG_INSTAKILL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6690,9 +6690,6 @@ static void P_MovePlayer(player_t *player)
|
||||||
|
|
||||||
fixed_t runspd;
|
fixed_t runspd;
|
||||||
|
|
||||||
if (countdowntimeup)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (player->mo->state >= &states[S_PLAY_SUPER_TRANS] && player->mo->state <= &states[S_PLAY_SUPER_TRANS9])
|
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;
|
player->mo->momx = player->mo->momy = player->mo->momz = 0;
|
||||||
|
|
Loading…
Reference in New Issue