Skip to content

Commit

Permalink
Fix disabled traits not being fully disabled sometimes
Browse files Browse the repository at this point in the history
  • Loading branch information
Archy-X committed Jun 12, 2024
1 parent 6038965 commit f5a289b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public double getBaseLevel(Player player, Trait trait) {
}

public void apply(Trait trait, Block block, Player player, User user, XpSource source) {
if (!trait.isEnabled()) return;
// Get the skill corresponding to the block trait
Skill skill = getSkill(trait);
if (skill == null) return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,10 @@ public double getEffectiveTraitLevel(Trait trait) {
}

public double getBonusTraitLevel(Trait trait) {
if (!trait.isEnabled()) {
return 0.0;
}

double level = 0.0;
for (Stat stat : plugin.getTraitManager().getLinkedStats(trait)) {
level += getStatLevel(stat) * stat.getTraitModifier(trait);
Expand Down

0 comments on commit f5a289b

Please sign in to comment.