Skip to content

Commit d11c55a

Browse files
authored
Merge pull request #39 from apple1417/master
add fixup for loot randomizer using bad type
2 parents b2d9168 + b9d9ebb commit d11c55a

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

changelog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## v3.5 (Upcoming)
44

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

88
### Willow2 Mod Menu v3.4
99
- Fixed that some keybinds would not be displayed properly if there were two separate grouped/nested

src/legacy_compat/meta_path_finder.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,5 +188,30 @@ def find_spec( # noqa: D102
188188
),
189189
)
190190

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

0 commit comments

Comments
 (0)