mirror of
https://github.com/rehan-remade/universal-modder.git
synced 2026-11-05 01:37:40 +00:00
[PR #45] [MERGED] fix(scan): match the most specific KNOWN game entry #81
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
rehan-remade/universal-modder#81
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/rehan-remade/universal-modder/pull/45
Author: @enk0r
Created: 10/4/2026
Status: ✅ Merged
Merged: 10/5/2026
Merged by: @rehan-remade
Base:
main← Head:fix/scan-known-game-shadowing📝 Commits (1)
88d0137fix(scan): match the most specific KNOWN game entry📊 Changes
2 files changed (+11 additions, -1 deletions)
View changed files
📝
tests/test_um.py(+10 -0)📝
um/scan.py(+1 -1)📄 Description
What
um scanpicks the known-game route with:known = next((v for k, v in KNOWN.items() if k == lname or (k in lname and len(k) > 5)), None)KNOWNcontains both"grand theft auto v"and"grand theft auto v enhanced", and "grand theft auto v" is a substring of "grand theft auto v enhanced".next()returns whichever matching key comes first in dict order, so the Enhanced entry has been dead code since it was added: every "Grand Theft Auto V Enhanced" install gets the legacy route.Impact
The legacy route tells the user/agent to use the plain ScriptHookV build plus OpenIV/CodeWalker; the Enhanced entry ("ScriptHookV (enhanced build) + ASI loader", no OpenIV/CodeWalker) can never be selected. Since agents read the scan report to choose a modding route, this silently sends GTA V Enhanced owners down a route that doesn't work.
Fix
Sort the candidate keys longest-first so the most specific entry wins:
known = next((v for k, v in sorted(KNOWN.items(), key=lambda kv: -len(kv[0])) if k == lname or (k in lname and len(k) > 5)), None)Test
test_known_game_longest_key_winsscans a folder named "Grand Theft Auto V Enhanced" and asserts the route comes from the Enhanced entry. It fails on the old code and passes with the fix. Full suite: 29 passed.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.