From 46496801017c56efaae212da1cd06935c059dafa Mon Sep 17 00:00:00 2001 From: ImmuState Date: Sat, 21 May 2022 10:43:55 -0700 Subject: [PATCH] Fix traveller not being able to gain energy. --- src/main/java/emu/grasscutter/game/avatar/Avatar.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/emu/grasscutter/game/avatar/Avatar.java b/src/main/java/emu/grasscutter/game/avatar/Avatar.java index f8f4e2358..31b3e8725 100644 --- a/src/main/java/emu/grasscutter/game/avatar/Avatar.java +++ b/src/main/java/emu/grasscutter/game/avatar/Avatar.java @@ -497,7 +497,7 @@ public class Avatar { float hpPercent = this.getFightProperty(FightProperty.FIGHT_PROP_MAX_HP) <= 0 ? 1f : this.getFightProperty(FightProperty.FIGHT_PROP_CUR_HP) / this.getFightProperty(FightProperty.FIGHT_PROP_MAX_HP); // Store current energy value for later - float currentEnergy = (data.getSkillDepot() != null) ? this.getFightProperty(data.getSkillDepot().getElementType().getCurEnergyProp()) : 0f; + float currentEnergy = (this.getSkillDepot() != null) ? this.getFightProperty(this.getSkillDepot().getElementType().getCurEnergyProp()) : 0f; // Clear properties this.getFightProperties().clear(); @@ -517,15 +517,15 @@ public class Avatar { } // Set energy usage - if (data.getSkillDepot() != null && data.getSkillDepot().getEnergySkillData() != null) { - ElementType element = data.getSkillDepot().getElementType(); - this.setFightProperty(element.getMaxEnergyProp(), data.getSkillDepot().getEnergySkillData().getCostElemVal()); + if (this.getSkillDepot() != null && this.getSkillDepot().getEnergySkillData() != null) { + ElementType element = this.getSkillDepot().getElementType(); + this.setFightProperty(element.getMaxEnergyProp(), this.getSkillDepot().getEnergySkillData().getCostElemVal()); if (GAME_OPTIONS.energyUsage) { this.setFightProperty(element.getCurEnergyProp(), currentEnergy); } else { - this.setFightProperty(element.getCurEnergyProp(), data.getSkillDepot().getEnergySkillData().getCostElemVal()); + this.setFightProperty(element.getCurEnergyProp(), this.getSkillDepot().getEnergySkillData().getCostElemVal()); } }