Server admins can now promote or demote any member of any faction to/from faction leader or officer using the existing /f leader and /f officer commands, with two new permissions added to allow that. A third permission is also added to allow server admins or moderators to join any faction without the need of /f bypass mode.
Also, a couple more minor bugfixes are included for /f home payment giving the wrong message, player/faction descriptions being wrong for console messages, and potential NPE in new faction leader promotion routine if faction was permanent with no current leader. New permissions: factions.leader.any - allows use of /f leader on any player in any faction factions officer.any - allows use of /f officer on any player in any faction factions.join.any - allows player to join any faction, bypassing invitation process for closed factions (the same as players with /f bypass enabled can do)
This commit is contained in:
@@ -443,7 +443,8 @@ public class Faction extends Entity implements EconomyParticipator
|
||||
{ // faction leader is the only member; one-man faction
|
||||
if (this.getFlag(FFlag.PERMANENT))
|
||||
{
|
||||
oldLeader.setRole(Rel.MEMBER);
|
||||
if (oldLeader != null)
|
||||
oldLeader.setRole(Rel.MEMBER);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -460,9 +461,10 @@ public class Faction extends Entity implements EconomyParticipator
|
||||
}
|
||||
else
|
||||
{ // promote new faction leader
|
||||
oldLeader.setRole(Rel.MEMBER);
|
||||
if (oldLeader != null)
|
||||
oldLeader.setRole(Rel.MEMBER);
|
||||
replacements.get(0).setRole(Rel.LEADER);
|
||||
this.msg("<i>Faction leader <h>%s<i> has been removed. %s<i> has been promoted as the new faction leader.", oldLeader.getName(), replacements.get(0).getName());
|
||||
this.msg("<i>Faction leader <h>%s<i> has been removed. %s<i> has been promoted as the new faction leader.", oldLeader == null ? "" : oldLeader.getName(), replacements.get(0).getName());
|
||||
P.p.log("Faction "+this.getTag()+" ("+this.getId()+") leader was removed. Replacement leader: "+replacements.get(0).getName());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user