diff --git a/src/fixed/game.h b/src/fixed/game.h index bccd1592..064d5ff1 100644 --- a/src/fixed/game.h +++ b/src/fixed/game.h @@ -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; + } } } diff --git a/src/fixed/lara.h b/src/fixed/lara.h index af1a67f3..a3d0c8b5 100644 --- a/src/fixed/lara.h +++ b/src/fixed/lara.h @@ -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)