mirror of
https://github.com/XProger/OpenLara.git
synced 2025-08-14 00:54:05 +02:00
fix use medikit with full health
This commit is contained in:
10
src/lara.h
10
src/lara.h
@@ -3141,10 +3141,12 @@ struct Lara : Character {
|
|||||||
switch (usedItem) {
|
switch (usedItem) {
|
||||||
case TR::Entity::INV_MEDIKIT_SMALL :
|
case TR::Entity::INV_MEDIKIT_SMALL :
|
||||||
case TR::Entity::INV_MEDIKIT_BIG :
|
case TR::Entity::INV_MEDIKIT_BIG :
|
||||||
damageTime = LARA_DAMAGE_TIME;
|
if (health < LARA_MAX_HEALTH) {
|
||||||
health = min(LARA_MAX_HEALTH, health + (usedItem == TR::Entity::INV_MEDIKIT_SMALL ? LARA_MAX_HEALTH / 2 : LARA_MAX_HEALTH));
|
damageTime = LARA_DAMAGE_TIME;
|
||||||
game->playSound(TR::SND_HEALTH, pos, Sound::PAN);
|
health = min(LARA_MAX_HEALTH, health + (usedItem == TR::Entity::INV_MEDIKIT_SMALL ? LARA_MAX_HEALTH / 2 : LARA_MAX_HEALTH));
|
||||||
inventory->remove(usedItem);
|
game->playSound(TR::SND_HEALTH, pos, Sound::PAN);
|
||||||
|
inventory->remove(usedItem);
|
||||||
|
}
|
||||||
usedItem = TR::Entity::NONE;
|
usedItem = TR::Entity::NONE;
|
||||||
default : ;
|
default : ;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user