ControllerDefinition - ToList() is better here I think?

This commit is contained in:
adelikat 2017-04-27 12:45:33 -05:00
parent 130f881ea0
commit 4c313e2a6a
1 changed files with 7 additions and 2 deletions

View File

@ -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;
}