From bbdb94007ec6cd7509bd196220945f4dd0e85a8f Mon Sep 17 00:00:00 2001 From: Evan Dixon Date: Mon, 14 May 2018 22:04:15 -0500 Subject: [PATCH] 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. --- PKHeX.WinForms/Controls/SAV Editor/SlotChangeManager.cs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/PKHeX.WinForms/Controls/SAV Editor/SlotChangeManager.cs b/PKHeX.WinForms/Controls/SAV Editor/SlotChangeManager.cs index 31699ef32..fc8ecfcae 100644 --- a/PKHeX.WinForms/Controls/SAV Editor/SlotChangeManager.cs +++ b/PKHeX.WinForms/Controls/SAV Editor/SlotChangeManager.cs @@ -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; }