mirror of
https://github.com/XProger/OpenLara.git
synced 2025-08-10 23:24:06 +02:00
#368 fix "No" sound
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -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)
|
||||
|
Reference in New Issue
Block a user