Simplify logic in PlayCry (#1944)

Local functions are cool and all, but for something this simple, it just hurts readability and makes things needlessly complex.
This commit is contained in:
Evan Dixon 2018-05-14 22:04:15 -05:00 committed by Kurt
parent 78c4dbd69c
commit bbdb94007e

View file

@ -177,14 +177,10 @@ namespace PKHeX.WinForms.Controls
if (pk.Species == 0)
return;
string resource = $"{pk.Species}-{pk.AltForm}";
string getpath() => Path.Combine(Main.CryPath, $"{resource}.wav");
var path = getpath();
var path = Path.Combine(Main.CryPath, $"{pk.Species}.wav");
if (!File.Exists(path))
{
resource = $"{pk.Species}";
path = getpath();
path = Path.Combine(Main.CryPath, $"{pk.Species}-{pk.AltForm}.wav");
if (!File.Exists(path))
return;
}