Fixed disband exploit

This commit is contained in:
ProSavage
2018-12-23 18:20:54 -06:00
parent 266c598b76
commit 7be48b5942
7 changed files with 15 additions and 7 deletions

View File

@@ -273,7 +273,9 @@ public interface Faction extends EconomyParticipator {
FPlayer getFPlayerAdmin();
ArrayList<FPlayer> getFPlayersWhereRole(Role role);
FPlayer getFPlayerLeader();
ArrayList<FPlayer> getFPlayersWhereRole(Role role);
ArrayList<Player> getOnlinePlayers();

View File

@@ -47,7 +47,7 @@ public class CmdDisband extends FCommand {
if (!fme.isAdminBypassing()) {
Access access = faction.getAccess(fme, PermissableAction.DISBAND);
if (fme.getRole() != Role.LEADER && access != Access.ALLOW) {
if (fme.getRole() != Role.LEADER && faction.getFPlayerLeader() != fme && access != Access.ALLOW) {
fme.msg(TL.GENERIC_FPERM_NOPERMISSION, "disband " + faction.getTag());
return;
}

View File

@@ -917,6 +917,7 @@ public abstract class MemoryFaction implements Faction, EconomyParticipator {
return ret;
}
public FPlayer getFPlayerAdmin() {
if (!this.isNormal()) {
return null;
@@ -930,6 +931,10 @@ public abstract class MemoryFaction implements Faction, EconomyParticipator {
return null;
}
public FPlayer getFPlayerLeader() {
return getFPlayerAdmin();
}
public ArrayList<FPlayer> getFPlayersWhereRole(Role role) {
ArrayList<FPlayer> ret = new ArrayList<>();
if (!this.isNormal()) {