From ed6168ea92860597ad3c1c83d2e916cb07f7b840 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Thu, 27 Nov 2008 17:47:37 +0000 Subject: [PATCH] - SBARINFO update: * Fixed: disabling lowerHealthCap didn't affect interpolateHealth. SVN r1295 (trunk) --- docs/rh-log.txt | 1 + src/g_shared/sbarinfo_display.cpp | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 53487f2a5..f5e28e53c 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,4 +1,5 @@ November 27, 2008 +- Fixed: disabling lowerHealthCap didn't affect interpolateHealth. - The co-op summary screen now has a totals row at the bottom (if it fits). - Changed WI_drawPercent() when wi_percents is false so that the total display is optional, and it formats it like Heretic's intermission, with diff --git a/src/g_shared/sbarinfo_display.cpp b/src/g_shared/sbarinfo_display.cpp index 5867b182a..5b01bfa82 100644 --- a/src/g_shared/sbarinfo_display.cpp +++ b/src/g_shared/sbarinfo_display.cpp @@ -296,13 +296,14 @@ void DSBarInfo::Tick () } else { - if(oldHealth > CPlayer->health) + int health = SBarInfoScript->lowerHealthCap ? CPlayer->health : CPlayer->mo->health; + if(oldHealth > health) { - oldHealth -= clamp((oldHealth - CPlayer->health) >> 2, 1, SBarInfoScript->interpolationSpeed); + oldHealth -= clamp((oldHealth - health), 1, SBarInfoScript->interpolationSpeed); } else if(oldHealth < CPlayer->health) { - oldHealth += clamp((CPlayer->health - oldHealth) >> 2, 1, SBarInfoScript->interpolationSpeed); + oldHealth += clamp((health - oldHealth), 1, SBarInfoScript->interpolationSpeed); } } AInventory *armor = CPlayer->mo->FindInventory();