This commit is contained in:
Jesse Boyd 2016-06-17 13:46:13 +10:00
parent b2b90a8d17
commit 4319300b34

View File

@ -217,18 +217,22 @@ public class FlagManager {
* @param id the flag to remove
* @return true if the plot contained the flag and was removed successfully
*/
public static boolean removePlotFlag(Plot plot, Flag<?> id) {
public static boolean removePlotFlag(Plot origin, Flag<?> id) {
for (Plot plot : origin.getConnectedPlots()) {
Object value = plot.getFlags().remove(id);
if (value == null) {
return false;
}
if (plot == origin) {
boolean result = EventUtil.manager.callFlagRemove(id, plot, value);
if (!result) {
plot.getFlags().put(id, value);
return false;
}
}
plot.reEnter();
DBFunc.setFlags(plot, plot.getFlags());
}
return true;
}