From 84c40909c758e1f20070db631baa1a9921a1172d Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Sun, 7 Mar 2021 22:47:39 -0300 Subject: [PATCH] Hide machine types with no available machines --- src/win/win_settings.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/win/win_settings.c b/src/win/win_settings.c index e999d6a64..3fc32a960 100644 --- a/src/win/win_settings.c +++ b/src/win/win_settings.c @@ -826,10 +826,17 @@ machine_type_get_internal_name(int id) int machine_type_available(int id) { - if ((id > 0) && (id < MACHINE_TYPE_MAX)) - return 1; - else - return 0; + int c = 0; + + if ((id > 0) && (id < MACHINE_TYPE_MAX)) { + while (machine_get_internal_name_ex(c) != NULL) { + if (machine_available(c) && (machines[c].type == id)) + return 1; + c++; + } + } + + return 0; }