From e2817c696ac25bebdd1fbbbaed6b0d0824f286e6 Mon Sep 17 00:00:00 2001 From: AnimeGitB Date: Thu, 12 May 2022 02:36:34 +0930 Subject: [PATCH] Fix immutable lists --- .../java/emu/grasscutter/game/managers/InventoryManager.java | 2 +- .../emu/grasscutter/server/packet/recv/HandlerBuyGoodsReq.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/emu/grasscutter/game/managers/InventoryManager.java b/src/main/java/emu/grasscutter/game/managers/InventoryManager.java index 7c0288318..6efe945aa 100644 --- a/src/main/java/emu/grasscutter/game/managers/InventoryManager.java +++ b/src/main/java/emu/grasscutter/game/managers/InventoryManager.java @@ -696,7 +696,7 @@ public class InventoryManager { } // Pay materials and mora if possible - List costs = proudSkill.getCostItems(); // Can this be null? + List costs = new ArrayList(proudSkill.getCostItems()); // Can this be null? if (proudSkill.getCoinCost() > 0) { costs.add(new ItemParamData(202, proudSkill.getCoinCost())); } diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerBuyGoodsReq.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerBuyGoodsReq.java index fc9564734..25cf05d24 100644 --- a/src/main/java/emu/grasscutter/server/packet/recv/HandlerBuyGoodsReq.java +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerBuyGoodsReq.java @@ -56,7 +56,7 @@ public class HandlerBuyGoodsReq extends PacketHandler { return; } - List costs = sg.getCostItemList(); // Can this even be null? + List costs = new ArrayList(sg.getCostItemList()); // Can this even be null? costs.add(new ItemParamData(202, sg.getScoin())); costs.add(new ItemParamData(201, sg.getHcoin())); costs.add(new ItemParamData(203, sg.getMcoin()));