Fix some errors

This commit is contained in:
libraryaddict 2013-12-02 23:31:43 +13:00
parent 55427dc1fe
commit 82e86f6669
2 changed files with 14 additions and 2 deletions

View File

@ -45,6 +45,18 @@ public abstract class TargetedDisguise extends Disguise {
targetType = newTargetType;
}
public void silentlySetViewDisguise(String playername) {
if (!disguiseViewers.contains(playername)) {
disguiseViewers.add(playername);
}
}
public void silentlyUnsetViewDisguise(String playername) {
if (disguiseViewers.contains(playername)) {
disguiseViewers.remove(playername);
}
}
public void setViewDisguise(String playername) {
if (!disguiseViewers.contains(playername)) {
disguiseViewers.add(playername);

View File

@ -65,7 +65,7 @@ public class DisguiseUtilities {
d.unsetViewDisguise(name);
} else {
for (String playername : disguise.getObservers()) {
d.unsetViewDisguise(playername);
d.silentlyUnsetViewDisguise(playername);
}
}
} else if (disguise.getTargetType() == TargetType.SHOW_TO_EVERYONE_BUT_THESE_PLAYERS) {
@ -90,7 +90,7 @@ public class DisguiseUtilities {
d.setViewDisguise(name);
} else {
for (String playername : disguise.getObservers()) {
d.setViewDisguise(playername);
d.silentlySetViewDisguise(playername);
}
}
} else if (disguise.getTargetType() == TargetType.SHOW_TO_EVERYONE_BUT_THESE_PLAYERS) {