From 540f20882ee1a9827feec5ff7125cc1f8d9241b8 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 4 Nov 2016 11:32:57 +0100 Subject: [PATCH] - fixed: Degeneration should use the same base health value as all the rest of the engine. - also replaced deh.MaxHealth in the bot code which was the only other remaining case where this was used as health limiter. --- src/b_think.cpp | 2 +- src/p_user.cpp | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/b_think.cpp b/src/b_think.cpp index 5a98b5c1ae..d097db8640 100644 --- a/src/b_think.cpp +++ b/src/b_think.cpp @@ -358,7 +358,7 @@ void DBot::WhatToGet (AActor *item) } else if ((typeis (Megasphere) || typeis (Soulsphere) || typeis (HealthBonus)) && player->mo->health >= deh.MaxSoulsphere) return; - else if (item->IsKindOf (RUNTIME_CLASS(AHealth)) && player->mo->health >= deh.MaxHealth /*MAXHEALTH*/) + else if (item->IsKindOf (RUNTIME_CLASS(AHealth)) && player->mo->health >= player->mo->GetMaxHealth() + player->mo->stamina) return; if ((dest == NULL || diff --git a/src/p_user.cpp b/src/p_user.cpp index b7bd4c2ec4..4a15e7f180 100644 --- a/src/p_user.cpp +++ b/src/p_user.cpp @@ -2677,10 +2677,11 @@ void P_PlayerThink (player_t *player) // Apply degeneration. if (dmflags2 & DF2_YES_DEGENERATION) { - if ((level.time % TICRATE) == 0 && player->health > deh.MaxHealth) + int maxhealth = player->mo->GetMaxHealth() + player->mo->stamina; + if ((level.time % TICRATE) == 0 && player->health > maxhealth) { - if (player->health - 5 < deh.MaxHealth) - player->health = deh.MaxHealth; + if (player->health - 5 < maxhealth) + player->health = maxhealth; else player->health--;