Skip to content

Commit

Permalink
Add additional safeguards for super vote permission calc
Browse files Browse the repository at this point in the history
Signed-off-by: applenick <applenick@users.noreply.github.com>
  • Loading branch information
applenick committed Jul 1, 2024
1 parent 0b6b95b commit 8d6b8b9
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ public void removeAllSuperVotePermissions() {
}

public int getMultipliedVoteLevel(Player player) {
return getVoteLevel(player) + config.getSuperVoteMultiplier();
return Math.min(
PGM.get().getConfiguration().getMaxExtraVotes(),
getVoteLevel(player) + config.getSuperVoteMultiplier());
}

public int getVoteLevel(Player player) {
Expand All @@ -102,7 +104,7 @@ public int getVoteLevel(Player player) {
return level;
}
}
return 0;
return 1;
}

public boolean isActive(Player player) {
Expand Down

0 comments on commit 8d6b8b9

Please sign in to comment.