mirror of
https://github.com/wiiu-env/WiiUPluginLoaderBackend.git
synced 2025-01-13 04:59:09 +01:00
Only check for config menu if the plugin is linked and loaded
This commit is contained in:
parent
b34fa84bed
commit
9e0932cb38
@ -84,6 +84,8 @@ void ConfigUtils::displayMenu() {
|
||||
info.pluginData = plugin.getPluginDataCopy();
|
||||
|
||||
std::unique_ptr<WUPSConfigAPIBackend::WUPSConfig> config;
|
||||
|
||||
if (plugin.isLinkedAndLoaded()) {
|
||||
if (const auto configData = plugin.getConfigData()) {
|
||||
if (const auto configHandleOpt = configData->createConfig()) {
|
||||
WUPSConfigAPIStatus callbackResult = configData->CallMenuOpenedCallback(configHandleOpt.value());
|
||||
@ -106,7 +108,7 @@ void ConfigUtils::displayMenu() {
|
||||
DEBUG_FUNCTION_LINE_ERR("Hook had invalid ptr");
|
||||
break;
|
||||
}
|
||||
auto cur_config_handle = reinterpret_cast<void *(*) ()>(static_cast<uint32_t *>(hook.getFunctionPointer()))();
|
||||
auto cur_config_handle = ((void *(*) ())((uint32_t *) hook.getFunctionPointer()))();
|
||||
if (cur_config_handle == nullptr) {
|
||||
DEBUG_FUNCTION_LINE_WARN("Hook returned empty handle");
|
||||
break;
|
||||
@ -119,6 +121,7 @@ void ConfigUtils::displayMenu() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!config) {
|
||||
config = make_unique_nothrow<WUPSConfigAPIBackend::WUPSConfig>(info.name);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user