From 7772ba4a1b7d26623fa28a7348a058459776900a Mon Sep 17 00:00:00 2001 From: Devin Date: Tue, 16 Nov 2021 19:47:49 +0100 Subject: [PATCH] Fix buy removal logic --- Assets/Scripts/Shop/Model/BuyModel.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Assets/Scripts/Shop/Model/BuyModel.cs b/Assets/Scripts/Shop/Model/BuyModel.cs index 9096317..3997de5 100644 --- a/Assets/Scripts/Shop/Model/BuyModel.cs +++ b/Assets/Scripts/Shop/Model/BuyModel.cs @@ -18,8 +18,8 @@ public class BuyModel : ShopModel public override void ConfirmSelectedItem() { - inventory.RemoveItemByIndex(selectedItemIndex); // Before removing the item from the model's actual inventory OnRemove(GetSelectedItem()); // If there's a view subscribed, this will probably remove the item from it + inventory.RemoveItemByIndex(selectedItemIndex); // Before removing the item from the model's actual inventory SelectItemByIndex(selectedItemIndex >= inventory.GetItemCount() ? --selectedItemIndex : selectedItemIndex); }