From 505ba1ff631c91d3f91a65bd728817fe19ea6d76 Mon Sep 17 00:00:00 2001 From: Shane Ellis Date: Fri, 15 Jan 2021 18:06:36 -0500 Subject: [PATCH] Update g_game.c --- src/g_game.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/g_game.c b/src/g_game.c index f1cae8cf5..43906e558 100644 --- a/src/g_game.c +++ b/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;