Skip to content

Commit

Permalink
Fix elementless Traveler depotValue
Browse files Browse the repository at this point in the history
  • Loading branch information
Birdulon committed Sep 2, 2022
1 parent 3658584 commit 735f765
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/main/java/emu/grasscutter/game/props/ElementType.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public enum ElementType {
@Getter private final int teamResonanceId;
@Getter private final FightProperty curEnergyProp;
@Getter private final FightProperty maxEnergyProp;
@Getter private int depotValue;
@Getter private final int depotValue;
@Getter private final int configHash;
private static final Int2ObjectMap<ElementType> map = new Int2ObjectOpenHashMap<>();
private static final Map<String, ElementType> stringMap = new HashMap<>();
Expand All @@ -39,26 +39,26 @@ public enum ElementType {
}

private ElementType(int value, FightProperty curEnergyProp, FightProperty maxEnergyProp) {
this(value, curEnergyProp, maxEnergyProp, 0, null);
this(value, curEnergyProp, maxEnergyProp, 0, null, 1);
}

private ElementType(int value, FightProperty curEnergyProp, FightProperty maxEnergyProp, int teamResonanceId, String configName) {
this(value, curEnergyProp, maxEnergyProp, teamResonanceId, configName, 1);
}

private ElementType(int value, FightProperty curEnergyProp, FightProperty maxEnergyProp, int teamResonanceId, String configName, int depotValue) {
this.value = value;
this.curEnergyProp = curEnergyProp;
this.maxEnergyProp = maxEnergyProp;
this.teamResonanceId = teamResonanceId;
this.depotValue = depotValue;
if (configName != null) {
this.configHash = Utils.abilityHash(configName);
} else {
this.configHash = 0;
}
}

private ElementType(int value, FightProperty curEnergyProp, FightProperty maxEnergyProp, int teamResonanceId, String configName, int depotValue) {
this(value, curEnergyProp, maxEnergyProp, teamResonanceId, configName);
this.depotValue = depotValue;
}

public static ElementType getTypeByValue(int value) {
return map.getOrDefault(value, None);
}
Expand Down

0 comments on commit 735f765

Please sign in to comment.