From 04ad20a7b128a579617cdb9c9be19a536ec926c4 Mon Sep 17 00:00:00 2001 From: patchzyy <64382339+patchzyy@users.noreply.github.com> Date: Sun, 18 Oct 2026 15:00:57 +0200 Subject: [PATCH] fill in old saved port identities --- aurora-main/lib/input.cpp | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/aurora-main/lib/input.cpp b/aurora-main/lib/input.cpp index f2df6f8..ccd1e0a 100644 --- a/aurora-main/lib/input.cpp +++ b/aurora-main/lib/input.cpp @@ -331,6 +331,7 @@ void apply_port_preferences() noexcept { std::array portClaimed{}; std::array claimedInstances{}; size_t claimedCount = 0; + bool upgraded = false; for (const auto& candidate : candidates) { if (portClaimed[candidate.port] || std::find(claimedInstances.begin(), claimedInstances.begin() + claimedCount, candidate.instance) != @@ -339,7 +340,25 @@ void apply_port_preferences() noexcept { } portClaimed[candidate.port] = true; claimedInstances[claimedCount++] = candidate.instance; - assign_player_index(g_GameControllers[candidate.instance], static_cast(candidate.port)); + auto& controller = g_GameControllers[candidate.instance]; + assign_player_index(controller, static_cast(candidate.port)); + + // Preferences saved before path and slot existed gain them on their first GUID match + auto& saved = g_portPreferences[candidate.port].identity; + if (candidate.score >= kScoreGuid && (saved.path.empty() || saved.slot < 0)) { + const auto current = controller_identity(controller); + if (saved.path.empty() && !current.path.empty()) { + saved.path = current.path; + upgraded = true; + } + if (saved.slot < 0 && current.slot >= 0) { + saved.slot = current.slot; + upgraded = true; + } + } + } + if (upgraded) { + save_port_preferences(); } }