From 8c8b2cc5438dc68735d886f9ab7eedf7d32f6cfe Mon Sep 17 00:00:00 2001 From: Alexander Batalov Date: Mon, 27 Feb 2023 15:10:35 +0300 Subject: [PATCH] Review use_inventory_on Fixes #46 --- src/game/inventry.cc | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/src/game/inventry.cc b/src/game/inventry.cc index ba031e6..8f18ef2 100644 --- a/src/game/inventry.cc +++ b/src/game/inventry.cc @@ -2266,21 +2266,7 @@ void use_inventory_on(Object* a1) int inventoryItemIndex = stack_offset[curr_stack] + keyCode - 1000; if (inventoryItemIndex < pud->length) { InventoryItem* inventoryItem = &(pud->items[inventoryItemIndex]); - if (isInCombat()) { - if (obj_dude->data.critter.combat.ap >= 2) { - if (action_use_an_item_on_object(obj_dude, a1, inventoryItem->item) != -1) { - int actionPoints = obj_dude->data.critter.combat.ap; - if (actionPoints < 2) { - obj_dude->data.critter.combat.ap = 0; - } else { - obj_dude->data.critter.combat.ap = actionPoints - 2; - } - intface_update_move_points(obj_dude->data.critter.combat.ap); - } - } - } else { - action_use_an_item_on_object(obj_dude, a1, inventoryItem->item); - } + action_use_an_item_on_object(stack[0], a1, inventoryItem->item); keyCode = KEY_ESCAPE; } else { keyCode = -1;