From 5811556630ce8cfb925d15809b40895e265b96fb Mon Sep 17 00:00:00 2001 From: logictc Date: Tue, 24 May 2022 16:59:14 -0400 Subject: [PATCH] don't take effect if energyUsage is false --- .../java/emu/grasscutter/game/avatar/Avatar.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/java/emu/grasscutter/game/avatar/Avatar.java b/src/main/java/emu/grasscutter/game/avatar/Avatar.java index 572bfb173..96a7b8478 100644 --- a/src/main/java/emu/grasscutter/game/avatar/Avatar.java +++ b/src/main/java/emu/grasscutter/game/avatar/Avatar.java @@ -360,7 +360,9 @@ public class Avatar { } public void setCurrentEnergy() { - this.setCurrentEnergy(this.currentEnergy); + if (GAME_OPTIONS.energyUsage) { + this.setCurrentEnergy(this.currentEnergy); + } } public void setCurrentEnergy(float currentEnergy) { @@ -378,9 +380,11 @@ public class Avatar { } public void setCurrentEnergy(FightProperty curEnergyProp, float currentEnergy) { - this.setFightProperty(curEnergyProp, currentEnergy); - this.currentEnergy = currentEnergy; - this.save(); + if (GAME_OPTIONS.energyUsage) { + this.setFightProperty(curEnergyProp, currentEnergy); + this.currentEnergy = currentEnergy; + this.save(); + } } public Int2FloatOpenHashMap getFightProperties() {