KH2: Fix lambda capture issue with weapon slot logic (#4604)

* KH2: Fix lambda capture issue with weapon slot logic

* Update Rules.py

* Improved by JaredWeakStrike (#4605)

* Apparently this wasn't meant to be indented

---------

Co-authored-by: JaredWeakStrike <96694163+JaredWeakStrike@users.noreply.github.com>
This commit is contained in:
NewSoupVi
2025-02-08 00:06:04 +01:00
committed by GitHub
parent 768ccffe72
commit f75a1ae117

View File

@@ -263,7 +263,10 @@ class KH2WorldRules(KH2Rules):
weapon_region = self.multiworld.get_region(RegionName.Keyblade, self.player)
for location in weapon_region.locations:
add_rule(location, lambda state: state.has(exclusion_table["WeaponSlots"][location.name], self.player))
if location.name in exclusion_table["WeaponSlots"]: # shop items and starting items are not in this list
exclusion_item = exclusion_table["WeaponSlots"][location.name]
add_rule(location, lambda state, e_item=exclusion_item: state.has(e_item, self.player))
if location.name in Goofy_Checks:
add_item_rule(location, lambda item: item.player == self.player and item.name in GoofyAbility_Table.keys())
elif location.name in Donald_Checks: