Skip to content

Commit

Permalink
Fix balance message being used for priority kick
Browse files Browse the repository at this point in the history
Signed-off-by: Pablo Herrera <[email protected]>
  • Loading branch information
Pablete1234 committed Nov 24, 2024
1 parent b932174 commit 4e80b34
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions core/src/main/java/tc/oc/pgm/join/JoinMatchModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ public boolean priorityKickAllowed() {
return getConfig().canPriorityKick() && !match.isRunning();
}

public boolean canPriorityKick(MatchPlayer player) {
JoinRequest request = requests.get(player.getBukkit());
return request != null && canPriorityKick(request);
}

public boolean canPriorityKick(JoinRequest request) {
return priorityKickAllowed() && request.isForcedOr(JoinRequest.Flag.JOIN_FULL);
}
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/tc/oc/pgm/teams/TeamMatchModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ public boolean kickPlayerOffTeam(Team kickFrom, boolean forBalance) {
}

// Give them the bad news
if (jmm.canBePriorityKicked(kickMe)) {
if (jmm.canPriorityKick(kickMe)) {
kickMe.sendMessage(translatable("join.ok.moved", kickTo.getName()));
kickMe.sendMessage(translatable("join.ok.moved.explanation"));
} else {
Expand Down

0 comments on commit 4e80b34

Please sign in to comment.