From 1184e6d674fe0c93bc6ae6cb6d68f57f80b7e6cd Mon Sep 17 00:00:00 2001 From: James R Date: Thu, 29 Jun 2023 23:32:17 -0700 Subject: [PATCH] Battle: win by having enough points when you kill a player --- src/k_kart.c | 8 +++++++- src/p_inter.c | 4 ++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/k_kart.c b/src/k_kart.c index 818d4d597..8aed081bb 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -3791,6 +3791,7 @@ void K_BattleAwardHit(player_t *player, player_t *victim, mobj_t *inflictor, UIN { UINT8 points = 1; boolean trapItem = false; + boolean finishOff = (victim->mo->health > 0) && (victim->mo->health <= damage); if (!(gametyperules & GTR_POINTLIMIT)) { @@ -3825,7 +3826,7 @@ void K_BattleAwardHit(player_t *player, player_t *victim, mobj_t *inflictor, UIN } else if (gametyperules & GTR_BUMPERS) { - if ((victim->mo->health > 0) && (victim->mo->health <= damage)) + if (finishOff) { // +2 points for finishing off a player points = 2; @@ -3835,6 +3836,11 @@ void K_BattleAwardHit(player_t *player, player_t *victim, mobj_t *inflictor, UIN P_AddPlayerScore(player, points); K_SpawnBattlePoints(player, victim, points); + + if ((gametyperules & GTR_BUMPERS) && finishOff && g_pointlimit <= player->roundscore) + { + P_DoAllPlayersExit(0, false); + } } void K_SpinPlayer(player_t *player, mobj_t *inflictor, mobj_t *source, INT32 type) diff --git a/src/p_inter.c b/src/p_inter.c index ef7e9367a..e14f08aa7 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -901,6 +901,10 @@ void P_CheckPointLimit(void) if (battleprisons) return; + // This will be handled by P_KillPlayer + if (gametyperules & GTR_BUMPERS) + return; + // pointlimit is nonzero, check if it's been reached by this player if (G_GametypeHasTeams()) {