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; 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) { public void setViewDisguise(String playername) {
if (!disguiseViewers.contains(playername)) { if (!disguiseViewers.contains(playername)) {
disguiseViewers.add(playername); disguiseViewers.add(playername);

View File

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