mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-08-20 12:25:21 -05: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:
@@ -177,14 +177,10 @@ private void PlayCry(PKM pk)
|
||||
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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user