Skip to content

Commit

Permalink
#368 fix "No" sound
Browse files Browse the repository at this point in the history
  • Loading branch information
XProger committed Jan 13, 2022
1 parent 29c2158 commit d411a7f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/fixed/game.h
Expand Up @@ -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;
}
}
}

Expand Down
8 changes: 5 additions & 3 deletions src/fixed/lara.h
Expand Up @@ -3780,7 +3780,7 @@ struct Lara : ItemObj
}
}

void useItem(InvSlot slot)
bool useItem(InvSlot slot)
{
switch (slot)
{
Expand All @@ -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)
Expand Down

0 comments on commit d411a7f

Please sign in to comment.