1
0
mirror of https://github.com/XProger/OpenLara.git synced 2025-08-12 08:04:09 +02:00

#368 fix "No" sound

This commit is contained in:
XProger
2022-01-14 02:57:34 +03:00
parent 29c215870b
commit d411a7f209
2 changed files with 8 additions and 4 deletions

View File

@@ -256,7 +256,9 @@ void gameUpdate(int32 frames)
if ((inventory.page != INV_PAGE_TITLE) && (inventory.state == INV_STATE_NONE))
{
lara->useItem(inventory.useSlot);
if (lara->useItem(inventory.useSlot)) {
inventory.useSlot = SLOT_MAX;
}
}
}

View File

@@ -3780,7 +3780,7 @@ struct Lara : ItemObj
}
}
void useItem(InvSlot slot)
bool useItem(InvSlot slot)
{
switch (slot)
{
@@ -3801,15 +3801,17 @@ struct Lara : ItemObj
if (health < LARA_MAX_HEALTH)
{
health += (slot == SLOT_MEDIKIT_BIG) ? LARA_MAX_HEALTH : (LARA_MAX_HEALTH >> 1);
if (health > LARA_MAX_HEALTH)
if (health > LARA_MAX_HEALTH) {
health = LARA_MAX_HEALTH;
}
inventory.remove(slot, 1);
extraL->healthTimer = 40;
soundPlay(SND_HEALTH, &pos);
}
break;
default: ;
default: return false;
}
return true;
}
virtual void hit(int32 damage, const vec3i &point, int32 soundId)