From 08a6bfd4df6b562223d538a3730e74ac9984b76a Mon Sep 17 00:00:00 2001 From: Yamagi Burmeister Date: Fri, 6 Sep 2019 07:13:29 +0200 Subject: [PATCH] Fix current health being reset to 100 if >100 at level change. This is another code inconsistency, we must not clamp the current health to the client max health (which apparently is always 100) but to the current max health of the player entity. Analyzed and fix suggest by @BjossiAlfreds, fixes yquake2/yquake2#441. --- src/g_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/g_main.c b/src/g_main.c index 47e0f6a..2dd0309 100644 --- a/src/g_main.c +++ b/src/g_main.c @@ -375,9 +375,9 @@ ExitLevel(void) continue; } - if (ent->health > ent->client->pers.max_health) + if (ent->health > ent->max_health) { - ent->health = ent->client->pers.max_health; + ent->health = ent->max_health; } }