Fix a npe

This commit is contained in:
Andrew 2013-07-23 02:06:19 +12:00
parent af6e6a1aa9
commit 6ae7d703b0

View File

@ -159,7 +159,8 @@ public enum DisguiseSound {
public SoundType getType(String name, boolean ignoreDamage) { public SoundType getType(String name, boolean ignoreDamage) {
if (isCancelSound(name)) if (isCancelSound(name))
return SoundType.CANCEL; return SoundType.CANCEL;
if (disguiseSounds.get(SoundType.STEP).startsWith("step.") && name.startsWith("step.")) if (disguiseSounds.containsKey(SoundType.STEP) && disguiseSounds.get(SoundType.STEP).startsWith("step.")
&& name.startsWith("step."))
return SoundType.STEP; return SoundType.STEP;
for (SoundType type : SoundType.values()) { for (SoundType type : SoundType.values()) {
if (!disguiseSounds.containsKey(type) || type == SoundType.DEATH || (ignoreDamage && type == SoundType.HURT)) if (!disguiseSounds.containsKey(type) || type == SoundType.DEATH || (ignoreDamage && type == SoundType.HURT))