Unverified Commit 004a765e authored by atArtyom's avatar atArtyom Committed by GitHub
Browse files

Fix food decreasing (#1834)

* Update InventorySystem.java

Fix some food didn't reduce after use.

* Update InventorySystem.java
parent a520bc94
......@@ -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);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment