mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-23 09:41:20 +00:00
Update g_game.c
This commit is contained in:
parent
225e7c72ac
commit
505ba1ff63
1 changed files with 24 additions and 1 deletions
25
src/g_game.c
25
src/g_game.c
|
@ -2974,7 +2974,8 @@ void G_DoReborn(INT32 playernum)
|
|||
// Make sure objectplace is OFF when you first start the level!
|
||||
OP_ResetObjectplace();
|
||||
|
||||
if (player->bot && playernum != consoleplayer)
|
||||
// Tailsbot
|
||||
if (player->bot && player->bot != 3 && playernum != consoleplayer)
|
||||
{ // Bots respawn next to their master.
|
||||
mobj_t *oldmo = NULL;
|
||||
|
||||
|
@ -2992,6 +2993,28 @@ void G_DoReborn(INT32 playernum)
|
|||
|
||||
return;
|
||||
}
|
||||
|
||||
// Additional players (e.g. independent bots) in Single Player
|
||||
if (playernum != consoleplayer && !(netgame || multiplayer))
|
||||
{
|
||||
mobj_t *oldmo = NULL;
|
||||
// Do nothing if out of lives
|
||||
if (player->lives <= 0)
|
||||
return;
|
||||
|
||||
// Otherwise do respawn, starting by removing the player object
|
||||
if (player->mo)
|
||||
{
|
||||
oldmo = player->mo;
|
||||
P_RemoveMobj(player->mo);
|
||||
}
|
||||
// Do spawning
|
||||
G_SpawnPlayer(playernum);
|
||||
if (oldmo)
|
||||
G_ChangePlayerReferences(oldmo, players[playernum].mo);
|
||||
|
||||
return; //Exit function to avoid proccing other SP related mechanics
|
||||
}
|
||||
|
||||
if (countdowntimeup || (!(netgame || multiplayer) && (gametyperules & GTR_CAMPAIGN)))
|
||||
resetlevel = true;
|
||||
|
|
Loading…
Reference in a new issue