mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-11-07 19:39:47 +01:00
Deleting a region flag also deletes group flag
The group flags set with /region flag -g have no effect if the normal flag is not also set, nor will they be displayed with /region info once the normal flag is deleted. However, if a group flag was to remain set in the database, the next time a user sets the normal flag, they might be surprised to suddenly see the corresponding group set as well. Since the -g group is presented to the user as an attribute of the normal flag, rather than a standalone flag, the group flag should be deleted along with the normal flag.
This commit is contained in:
parent
7e419c116e
commit
bb9dff7b8c
@ -798,6 +798,12 @@ public void flag(CommandContext args, CommandSender sender) throws CommandExcept
|
||||
// Clear the flag only if neither [value] nor [-g group] was given
|
||||
region.setFlag(foundFlag, null);
|
||||
|
||||
// Also clear the associated group flag if one exists
|
||||
RegionGroupFlag groupFlag = foundFlag.getRegionGroupFlag();
|
||||
if (groupFlag != null) {
|
||||
region.setFlag(groupFlag, null);
|
||||
}
|
||||
|
||||
sender.sendMessage(ChatColor.YELLOW
|
||||
+ "Region flag '" + foundFlag.getName() + "' cleared.");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user