mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-23 12:33:06 +00:00
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:
parent
78c4dbd69c
commit
bbdb94007e
1 changed files with 2 additions and 6 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue