Skip to content

Commit

Permalink
Fix Playsound
Browse files Browse the repository at this point in the history
  • Loading branch information
Morphan1 committed Jul 31, 2013
1 parent 67d7b04 commit ea4a256
Showing 1 changed file with 9 additions and 9 deletions.
Expand Up @@ -39,15 +39,6 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException
if (!scriptEntry.hasObject("location")
&& arg.matchesArgumentType(dLocation.class))
scriptEntry.addObject("location", arg.asType(dLocation.class));

else if (!scriptEntry.hasObject("sound")
&& Sound.valueOf(arg.toString()) != null) {
try {
scriptEntry.addObject("sound", Sound.valueOf(arg.toString()));
} catch (Exception e) {
dB.echoError("Invalid sound!");
}
}

else if (!scriptEntry.hasObject("volume")
&& arg.matchesPrimitive(aH.PrimitiveType.Double)
Expand All @@ -58,6 +49,15 @@ else if (!scriptEntry.hasObject("pitch")
&& arg.matchesPrimitive(aH.PrimitiveType.Double)
&& arg.matchesPrefix("pitch, p"))
scriptEntry.addObject("pitch", arg.asElement());

else if (!scriptEntry.hasObject("sound")
&& arg.matchesPrimitive(aH.PrimitiveType.String)) {
try {
scriptEntry.addObject("sound", Sound.valueOf(arg.asElement().asString().toUpperCase()));
} catch (Exception e) {
dB.echoError("Invalid sound!");
}
}

}

Expand Down

0 comments on commit ea4a256

Please sign in to comment.