From 4c313e2a6acf7af79865e4383c866c203d9fcb93 Mon Sep 17 00:00:00 2001 From: adelikat Date: Thu, 27 Apr 2017 12:45:33 -0500 Subject: [PATCH] ControllerDefinition - ToList() is better here I think? --- .../Base Implementations/ControllerDefinition.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/BizHawk.Emulation.Common/Base Implementations/ControllerDefinition.cs b/BizHawk.Emulation.Common/Base Implementations/ControllerDefinition.cs index 13cd1fa98b..5ad465de88 100644 --- a/BizHawk.Emulation.Common/Base Implementations/ControllerDefinition.cs +++ b/BizHawk.Emulation.Common/Base Implementations/ControllerDefinition.cs @@ -195,7 +195,7 @@ namespace BizHawk.Emulation.Common { get { - var list = FloatControls.Union(BoolButtons); + var list = FloatControls.Union(BoolButtons).ToList(); if (list.Any(b => b.StartsWith("P8"))) { return 8; } if (list.Any(b => b.StartsWith("P7"))) { return 7; } if (list.Any(b => b.StartsWith("P6"))) { return 6; } @@ -204,7 +204,12 @@ namespace BizHawk.Emulation.Common if (list.Any(b => b.StartsWith("P3"))) { return 3; } if (list.Any(b => b.StartsWith("P2"))) { return 2; } if (list.Any(b => b.StartsWith("P1"))) { return 1; } - if (list.Any(b => b.StartsWith("Up"))) { return 1; } // Hack for things like gameboy/ti-83 as opposed to genesis with no controllers plugged in + + // Hack for things like gameboy/ti-83 as opposed to genesis with no controllers plugged in + if (list.Any(b => b.StartsWith("Up"))) + { + return 1; + } return 0; }