mirror of
https://github.com/fabiangreffrath/woof.git
synced 2025-09-22 03:12:00 -04:00
fix ouch face when health increases significantly (#2055)
* restore old CalcPainOffset function
This commit is contained in:
parent
ac5ec75838
commit
e48e8c2cb8
@ -540,10 +540,15 @@ static int ResolveNumber(sbe_number_t *number, player_t *player)
|
||||
|
||||
static int CalcPainOffset(sbe_face_t *face, player_t *player)
|
||||
{
|
||||
static int lasthealthcalc;
|
||||
static int oldhealth = -1;
|
||||
int health = player->health > 100 ? 100 : player->health;
|
||||
int lasthealthcalc =
|
||||
ST_FACESTRIDE * (((100 - health) * ST_NUMPAINFACES) / 101);
|
||||
face->oldhealth = health;
|
||||
if (oldhealth != health)
|
||||
{
|
||||
lasthealthcalc =
|
||||
ST_FACESTRIDE * (((100 - health) * ST_NUMPAINFACES) / 101);
|
||||
oldhealth = health;
|
||||
}
|
||||
return lasthealthcalc;
|
||||
}
|
||||
|
||||
@ -726,6 +731,8 @@ static void UpdateFace(sbe_face_t *face, player_t *player)
|
||||
}
|
||||
|
||||
--face->facecount;
|
||||
|
||||
face->oldhealth = player->health;
|
||||
}
|
||||
|
||||
static void UpdateNumber(sbarelem_t *elem, player_t *player)
|
||||
|
Loading…
x
Reference in New Issue
Block a user