From edd7b483afc01011ba9a5fc71443f7088f746070 Mon Sep 17 00:00:00 2001 From: Ryley Kimmel Date: Wed, 25 Feb 2015 15:30:46 -0500 Subject: [PATCH] Don't map item amount in Inventory#add(int, int). --- src/org/apollo/game/model/inv/Inventory.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/org/apollo/game/model/inv/Inventory.java b/src/org/apollo/game/model/inv/Inventory.java index d39e7ac6..b94a8ed5 100644 --- a/src/org/apollo/game/model/inv/Inventory.java +++ b/src/org/apollo/game/model/inv/Inventory.java @@ -117,8 +117,8 @@ public final class Inventory { * @return The amount that remains. */ public int add(int id, int amount) { - Optional optionalItem = add(new Item(id, amount)); - return optionalItem.map(item -> optionalItem.isPresent() ? item.getAmount() : 0).get(); + Optional item = add(new Item(id, amount)); + return item.isPresent() ? item.get().getAmount() : 0; } /**