From 479104ee05d63a8053168aaf800c0478149978bf Mon Sep 17 00:00:00 2001 From: radius Date: Mon, 10 Dec 2018 23:27:04 -0500 Subject: [PATCH] cleanup task_content.c too --- tasks/task_content.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tasks/task_content.c b/tasks/task_content.c index ceb4bbf173..36883c1adb 100644 --- a/tasks/task_content.c +++ b/tasks/task_content.c @@ -1781,12 +1781,18 @@ int content_get_subsystem() void content_set_subsystem(unsigned idx) { rarch_system_info_t *system = runloop_get_system_info(); - const struct retro_subsystem_info *subsystem = system ? - subsystem_data + idx : NULL; + const struct retro_subsystem_info *subsystem; - pending_subsystem_id = idx; + /* Core fully loaded, use the subsystem data */ + if (system->subsystem.data) + subsystem = system->subsystem.data + idx; + /* Core not loaded completely, use the data we peeked on load core */ + else + subsystem = subsystem_data + idx; - if (subsystem_current_count > 0) + pending_subsystem_id = idx; + + if (subsystem && subsystem_current_count > 0) { strlcpy(pending_subsystem_ident, subsystem->ident, sizeof(pending_subsystem_ident));