Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix balance message being used for priority kick #1436

Merged
merged 1 commit into from
Nov 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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