1
0
mirror of https://github.com/XProger/OpenLara.git synced 2025-02-24 15:32:30 +01:00

fix use medikit with full health

This commit is contained in:
XProger 2018-11-29 07:05:04 +03:00
parent a20c29a7b9
commit 5835b77cfc

View File

@ -3141,10 +3141,12 @@ struct Lara : Character {
switch (usedItem) {
case TR::Entity::INV_MEDIKIT_SMALL :
case TR::Entity::INV_MEDIKIT_BIG :
damageTime = LARA_DAMAGE_TIME;
health = min(LARA_MAX_HEALTH, health + (usedItem == TR::Entity::INV_MEDIKIT_SMALL ? LARA_MAX_HEALTH / 2 : LARA_MAX_HEALTH));
game->playSound(TR::SND_HEALTH, pos, Sound::PAN);
inventory->remove(usedItem);
if (health < LARA_MAX_HEALTH) {
damageTime = LARA_DAMAGE_TIME;
health = min(LARA_MAX_HEALTH, health + (usedItem == TR::Entity::INV_MEDIKIT_SMALL ? LARA_MAX_HEALTH / 2 : LARA_MAX_HEALTH));
game->playSound(TR::SND_HEALTH, pos, Sound::PAN);
inventory->remove(usedItem);
}
usedItem = TR::Entity::NONE;
default : ;
}