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.
This commit is contained in:
Yamagi Burmeister 2019-09-06 07:13:29 +02:00
parent 244e0cfa01
commit 08a6bfd4df
1 changed files with 2 additions and 2 deletions

View File

@ -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;
}
}