Fixed disband exploit
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user