Skip to content

Commit 205c6ac

Browse files
authored
lufia2ac: fix client behavior at max blue chests combined with party member or capsule monster shuffle (#2478)
When option combinations at (or near) the maximum location count were used, the client could trip over a wrongly coded limit and stop sending checks.
1 parent 2f6b683 commit 205c6ac

File tree

4 files changed

+4
-3
lines changed

4 files changed

+4
-3
lines changed

worlds/lufia2ac/Client.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ async def game_watcher(self, ctx: SNIContext) -> None:
113113
}],
114114
}])
115115

116-
total_blue_chests_checked: int = min(sum(blue_chests_checked.values()), BlueChestCount.range_end)
116+
total_blue_chests_checked: int = min(sum(blue_chests_checked.values()), BlueChestCount.overall_max)
117117
snes_buffered_write(ctx, L2AC_TX_ADDR + 8, total_blue_chests_checked.to_bytes(2, "little"))
118118
location_ids: List[int] = [locations_start_id + i for i in range(total_blue_chests_checked)]
119119

worlds/lufia2ac/Locations.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
start_id: int = 0xAC0000
77

88
l2ac_location_name_to_id: Dict[str, int] = {
9-
**{f"Blue chest {i + 1}": (start_id + i) for i in range(BlueChestCount.range_end + 7 + 6)},
9+
**{f"Blue chest {i + 1}": (start_id + i) for i in range(BlueChestCount.overall_max)},
1010
**{f"Iris treasure {i + 1}": (start_id + 0x039C + i) for i in range(9)},
1111
"Boss": start_id + 0x01C2,
1212
}

worlds/lufia2ac/Options.py

+1
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ class BlueChestCount(Range):
121121
range_start = 10
122122
range_end = 100
123123
default = 25
124+
overall_max = range_end + 7 + 6 # Have to account for capsule monster and party member items
124125

125126

126127
class Boss(RandomGroupsChoice):

worlds/lufia2ac/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class L2ACWorld(World):
6666
"Party members": {name for name, data in l2ac_item_table.items() if data.type is ItemType.PARTY_MEMBER},
6767
}
6868
data_version: ClassVar[int] = 2
69-
required_client_version: Tuple[int, int, int] = (0, 4, 2)
69+
required_client_version: Tuple[int, int, int] = (0, 4, 4)
7070

7171
# L2ACWorld specific properties
7272
rom_name: bytearray

0 commit comments

Comments
 (0)