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:17:14 +02:00
parent 119b9369e8
commit e4daf3c070

View file

@ -396,9 +396,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;
}
}