From 004a765e5be775d3b507514527ff3868fbebe396 Mon Sep 17 00:00:00 2001 From: atArtyom <70076729+atArtyom@users.noreply.github.com> Date: Fri, 7 Oct 2022 18:14:29 +0300 Subject: [PATCH] Fix food decreasing (#1834) * Update InventorySystem.java Fix some food didn't reduce after use. * Update InventorySystem.java --- .../java/emu/grasscutter/game/systems/InventorySystem.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/emu/grasscutter/game/systems/InventorySystem.java b/src/main/java/emu/grasscutter/game/systems/InventorySystem.java index f2e323d6b..261c1f0bb 100644 --- a/src/main/java/emu/grasscutter/game/systems/InventorySystem.java +++ b/src/main/java/emu/grasscutter/game/systems/InventorySystem.java @@ -851,7 +851,8 @@ public class InventorySystem extends BaseGameSystem { switch (useData.getUseOp()) { case ITEM_USE_ADD_SERVER_BUFF -> { int buffId = Integer.parseInt(useData.getUseParam()[0]); - float time = Float.parseFloat(useData.getUseParam()[1]); + String timeString = useData.getUseParam()[1]; + float time = timeString.isEmpty() ? 0 : Float.parseFloat(timeString); player.getBuffManager().addBuff(buffId, time); }