From 79ccad1fd40a91b22895dceb6c718aa79cc009f2 Mon Sep 17 00:00:00 2001 From: Maschell Date: Sun, 9 Feb 2025 10:26:09 +0100 Subject: [PATCH] fix: Do title specific patches more than once --- src/config.cpp | 1 - src/config.h | 4 ---- src/main.cpp | 13 ++++++------- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/config.cpp b/src/config.cpp index d246580..66a78c4 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -17,7 +17,6 @@ #include "config.h" -bool Config::internal_init_done = false; bool Config::connect_to_network = false; bool Config::initialized = false; bool Config::shown_warning = false; diff --git a/src/config.h b/src/config.h index 966a655..8455bb0 100644 --- a/src/config.h +++ b/src/config.h @@ -5,12 +5,8 @@ #ifndef INKAY_CONFIG_H #define INKAY_CONFIG_H -#include -#include - class Config { public: - static bool internal_init_done; static bool connect_to_network; diff --git a/src/main.cpp b/src/main.cpp index 9e3b085..7e6d196 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -208,13 +208,12 @@ WUMS_APPLICATION_STARTS() { } WUMS_ALL_APPLICATION_STARTS_DONE() { - if (!Config::internal_init_done) { - setup_olv_libs(); - peertopeer_patch(); - matchmaking_notify_titleswitch(); - hotpatchAccountSettings(); - Config::internal_init_done = true; - } + // we need to do the patches here because otherwise the Config::connect_to_network flag might be set yet + setup_olv_libs(); + peertopeer_patch(); + matchmaking_notify_titleswitch(); + hotpatchAccountSettings(); + if (Config::initialized && !Config::plugin_is_loaded) { DEBUG_FUNCTION_LINE("Inkay is running but the plugin got unloaded"); if (!Config::block_initialize) {