mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-29 12:40:58 +00:00
LF2_NORELOAD support
This commit is contained in:
parent
3723eff9f7
commit
c508695c5a
1 changed files with 54 additions and 7 deletions
61
src/g_game.c
61
src/g_game.c
|
@ -2547,11 +2547,8 @@ void G_DoReborn(INT32 playernum)
|
||||||
if (!countdowntimeup && (mapheaderinfo[gamemap-1]->levelflags & LF_NORELOAD))
|
if (!countdowntimeup && (mapheaderinfo[gamemap-1]->levelflags & LF_NORELOAD))
|
||||||
{
|
{
|
||||||
INT32 i;
|
INT32 i;
|
||||||
|
|
||||||
player->playerstate = PST_REBORN;
|
player->playerstate = PST_REBORN;
|
||||||
|
|
||||||
P_LoadThingsOnly();
|
P_LoadThingsOnly();
|
||||||
|
|
||||||
P_ClearStarPost(player->starpostnum);
|
P_ClearStarPost(player->starpostnum);
|
||||||
|
|
||||||
// Do a wipe
|
// Do a wipe
|
||||||
|
@ -2567,7 +2564,7 @@ void G_DoReborn(INT32 playernum)
|
||||||
|
|
||||||
// clear cmd building stuff
|
// clear cmd building stuff
|
||||||
memset(gamekeydown, 0, sizeof (gamekeydown));
|
memset(gamekeydown, 0, sizeof (gamekeydown));
|
||||||
for (i = 0;i < JOYAXISSET; i++)
|
for (i = 0; i < JOYAXISSET; i++)
|
||||||
{
|
{
|
||||||
joyxmove[i] = joyymove[i] = 0;
|
joyxmove[i] = joyymove[i] = 0;
|
||||||
joy2xmove[i] = joy2ymove[i] = 0;
|
joy2xmove[i] = joy2ymove[i] = 0;
|
||||||
|
@ -2600,10 +2597,10 @@ void G_DoReborn(INT32 playernum)
|
||||||
INT32 i;
|
INT32 i;
|
||||||
for (i = 0; i < MAXPLAYERS; i++)
|
for (i = 0; i < MAXPLAYERS; i++)
|
||||||
{
|
{
|
||||||
if (!(playeringame[i] && players[i].mo && players[i].mo->health && players[i].playerstate == PST_LIVE))
|
if (!(playeringame[i] && players[i].playerstate == PST_LIVE))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if ((netgame || multiplayer) && players[i].spectator) // Ignore spectators
|
if (players[i].spectator) // Ignore spectators
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (players[i].bot) // ignore dumb, stupid tails
|
if (players[i].bot) // ignore dumb, stupid tails
|
||||||
|
@ -2612,7 +2609,57 @@ void G_DoReborn(INT32 playernum)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (i == MAXPLAYERS)
|
if (i == MAXPLAYERS)
|
||||||
RESETMAP;
|
{
|
||||||
|
if (mapheaderinfo[gamemap-1]->levelflags & LF_NORELOAD)
|
||||||
|
{
|
||||||
|
INT32 j;
|
||||||
|
|
||||||
|
for (i = 0; i < MAXPLAYERS; i++)
|
||||||
|
{
|
||||||
|
if (!playeringame[i])
|
||||||
|
continue;
|
||||||
|
|
||||||
|
players[i].playerstate = PST_REBORN;
|
||||||
|
}
|
||||||
|
|
||||||
|
P_LoadThingsOnly();
|
||||||
|
P_ClearStarPost(player->starpostnum);
|
||||||
|
|
||||||
|
// Do a wipe
|
||||||
|
wipegamestate = -1;
|
||||||
|
|
||||||
|
if (camera.chase)
|
||||||
|
P_ResetCamera(&players[displayplayer], &camera);
|
||||||
|
if (camera2.chase && splitscreen)
|
||||||
|
P_ResetCamera(&players[secondarydisplayplayer], &camera2);
|
||||||
|
|
||||||
|
// clear cmd building stuff
|
||||||
|
memset(gamekeydown, 0, sizeof (gamekeydown));
|
||||||
|
for (j = 0; j < JOYAXISSET; j++)
|
||||||
|
{
|
||||||
|
joyxmove[j] = joyymove[j] = 0;
|
||||||
|
joy2xmove[j] = joy2ymove[j] = 0;
|
||||||
|
}
|
||||||
|
mousex = mousey = 0;
|
||||||
|
mouse2x = mouse2y = 0;
|
||||||
|
|
||||||
|
// clear hud messages remains (usually from game startup)
|
||||||
|
CON_ClearHUD();
|
||||||
|
|
||||||
|
// Starpost support
|
||||||
|
for (i = 0; i < MAXPLAYERS; i++)
|
||||||
|
{
|
||||||
|
if (!playeringame[i])
|
||||||
|
continue;
|
||||||
|
|
||||||
|
G_SpawnPlayer(i, (players[i].starposttime != 0));
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
RESETMAP;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (player->starposttime)
|
if (player->starposttime)
|
||||||
|
|
Loading…
Reference in a new issue