From 9980631e2f92ce5e88d17d4d0c6a62fb35576106 Mon Sep 17 00:00:00 2001 From: toaster Date: Sun, 8 Jan 2023 13:58:14 +0000 Subject: [PATCH 1/2] Fix bots' `realtime` not ticking upwards when all human players have exited This corrects the issue where bots have the same time on exit as the last human player, and therefore tie with them, with disastrous consequences for GP. --- src/p_user.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index d626e1e19..c00991850 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -2664,7 +2664,7 @@ static void P_DeathThink(player_t *player) } // Keep time rolling - if (!(exitcountdown && !racecountdown) && !(player->exiting || mapreset) && !(player->pflags & PF_NOCONTEST) && !stoppedclock) + if (!(player->exiting || mapreset) && !(player->pflags & PF_NOCONTEST) && !stoppedclock) { if (leveltime >= starttime) { @@ -4023,7 +4023,7 @@ void P_PlayerThink(player_t *player) } // Synchronizes the "real" amount of time spent in the level. - if (!(exitcountdown && !racecountdown) && !(player->exiting || mapreset) && !(player->pflags & PF_NOCONTEST) && !stoppedclock) + if (!(player->exiting || mapreset) && !(player->pflags & PF_NOCONTEST) && !stoppedclock) { if (leveltime >= starttime) { From 3d9137a9cf964928e9d7de0916fa4bb237fe6091 Mon Sep 17 00:00:00 2001 From: toaster Date: Sun, 8 Jan 2023 14:02:02 +0000 Subject: [PATCH 2/2] Pre-emptively fixes a possible issue where a player who is exiting would have their realtime adjusted on respawn, affecting final results. --- src/p_mobj.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 24d881471..b5bb16c45 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -11735,7 +11735,11 @@ void P_SpawnPlayer(INT32 playernum) mobj->health = 1; p->playerstate = PST_LIVE; - p->realtime = leveltime; + if (!p->exiting || !p->realtime) + { + p->realtime = leveltime; + } + p->followitem = skins[p->skin].followitem; //awayview stuff