Skip to content

Commit

Permalink
hiscore panel: fix total level breakage
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderhenne committed Apr 16, 2018
1 parent 0d46be7 commit 5e389d0
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,29 +27,29 @@
public enum HiscoreSkill
{
OVERALL("Overall"),
ATTACK("Attack"),
DEFENCE("Defence"),
STRENGTH("Strength"),
HITPOINTS("Hitpoints"),
RANGED("Ranged"),
PRAYER("Prayer"),
MAGIC("Magic"),
COOKING("Cooking"),
WOODCUTTING("Woodcutting"),
FLETCHING("Fletching"),
FISHING("Fishing"),
FIREMAKING("Firemaking"),
CRAFTING("Crafting"),
SMITHING("Smithing"),
MINING("Mining"),
HERBLORE("Herblore"),
AGILITY("Agility"),
THIEVING("Thieving"),
SLAYER("Slayer"),
FARMING("Farming"),
RUNECRAFT("Runecraft"),
HUNTER("Hunter"),
CONSTRUCTION("Construction"),
ATTACK("Attack", true),
DEFENCE("Defence", true),
STRENGTH("Strength", true),
HITPOINTS("Hitpoints", true),
RANGED("Ranged", true),
PRAYER("Prayer", true),
MAGIC("Magic", true),
COOKING("Cooking", true),
WOODCUTTING("Woodcutting", true),
FLETCHING("Fletching", true),
FISHING("Fishing", true),
FIREMAKING("Firemaking", true),
CRAFTING("Crafting", true),
SMITHING("Smithing", true),
MINING("Mining", true),
HERBLORE("Herblore", true),
AGILITY("Agility", true),
THIEVING("Thieving", true),
SLAYER("Slayer", true),
FARMING("Farming", true),
RUNECRAFT("Runecraft", true),
HUNTER("Hunter", true),
CONSTRUCTION("Construction", true),
CLUE_SCROLL_EASY("Clue Scrolls (easy)"),
CLUE_SCROLL_MEDIUM("Clue Scrolls (medium)"),
CLUE_SCROLL_ALL("Clue Scrolls (all)"),
Expand All @@ -61,14 +61,26 @@ public enum HiscoreSkill
CLUE_SCROLL_MASTER("Clue Scrolls (master)");

private final String name;
private final boolean virtualLevels;

HiscoreSkill(String name)
{
this(name, false);
}

HiscoreSkill(String name, boolean virtualLevels)
{
this.name = name;
this.virtualLevels = virtualLevels;
}

public String getName()
{
return name;
}

public boolean hasVirtualLevels()
{
return virtualLevels;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ else if (result.getSkill(skill) != null && result.getSkill(skill).getRank() != -
Skill s = result.getSkill(skill);

int level;
if (config.virtualLevels() && s.getExperience() >= 0)
if (config.virtualLevels() && skill.hasVirtualLevels())
{
level = Experience.getLevelForXp((int) s.getExperience());
}
Expand Down

0 comments on commit 5e389d0

Please sign in to comment.