From f75a1ae1174fb467e5c5bd5568d7de3c806d5b1c Mon Sep 17 00:00:00 2001 From: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com> Date: Sat, 8 Feb 2025 00:06:04 +0100 Subject: [PATCH] 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> --- worlds/kh2/Rules.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/worlds/kh2/Rules.py b/worlds/kh2/Rules.py index 767c5643..a59fbfd8 100644 --- a/worlds/kh2/Rules.py +++ b/worlds/kh2/Rules.py @@ -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: