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:
parent
a20c29a7b9
commit
5835b77cfc
10
src/lara.h
10
src/lara.h
@ -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 : ;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user