Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add fixup for loot randomizer using bad type #39

Merged
merged 2 commits into from
Feb 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## v3.5 (Upcoming)

### Legacy Compat v1.4
- Added more fixups for previously unreported issues in Reign of Giants.
- Added more fixups for previously unreported issues in Loot Randomizer and Reign of Giants.

### Willow2 Mod Menu v3.4
- Fixed that some keybinds would not be displayed properly if there were two separate grouped/nested
Expand Down
25 changes: 25 additions & 0 deletions src/legacy_compat/meta_path_finder.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,5 +188,30 @@ def find_spec( # noqa: D102
),
)

# Loot randomizer needs a few fixes
case (
# Here's the downside of using a single folder name, these cases just look weird.
("Mod", "Mods.LootRandomizer.Mod.missions")
# Newer versions split the files
| ("Mod", "Mods.LootRandomizer.Mod.bl2.locations")
):
return spec_with_replacements(
fullname,
path,
target,
# It called these functions with a bad arg type in two places. This is
# essentially undefined behaviour, so now gives an exception. Luckily, in this
# case the functions actually validated their arg, so this just became a no-op.
# Remove the two bad calls.
(rb"get_missiontracker\(\)\.(Unr|R)egisterMissionDirector\(giver\)", b"pass"),
# There's some code to hide Face McShooty's body on re-accepting the quest. I
# think this broke due to the removal of CallPostEdit. Swapping it to use the
# setter functions makes it work again.
(
rb"pawn.bHidden = True([\r\n]+ +)pawn.CollisionType = 1",
rb"pawn.SetHidden(True)\1pawn.SetCollisionType(1)",
),
)

case _, _:
return None