Skip to content

Commit

Permalink
lufia2ac: fix client behavior at max blue chests combined with party …
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
el-u authored Nov 24, 2023
1 parent 2f6b683 commit 205c6ac
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion worlds/lufia2ac/Client.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ async def game_watcher(self, ctx: SNIContext) -> None:
}],
}])

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

Expand Down
2 changes: 1 addition & 1 deletion worlds/lufia2ac/Locations.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
start_id: int = 0xAC0000

l2ac_location_name_to_id: Dict[str, int] = {
**{f"Blue chest {i + 1}": (start_id + i) for i in range(BlueChestCount.range_end + 7 + 6)},
**{f"Blue chest {i + 1}": (start_id + i) for i in range(BlueChestCount.overall_max)},
**{f"Iris treasure {i + 1}": (start_id + 0x039C + i) for i in range(9)},
"Boss": start_id + 0x01C2,
}
Expand Down
1 change: 1 addition & 0 deletions worlds/lufia2ac/Options.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ class BlueChestCount(Range):
range_start = 10
range_end = 100
default = 25
overall_max = range_end + 7 + 6 # Have to account for capsule monster and party member items


class Boss(RandomGroupsChoice):
Expand Down
2 changes: 1 addition & 1 deletion worlds/lufia2ac/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class L2ACWorld(World):
"Party members": {name for name, data in l2ac_item_table.items() if data.type is ItemType.PARTY_MEMBER},
}
data_version: ClassVar[int] = 2
required_client_version: Tuple[int, int, int] = (0, 4, 2)
required_client_version: Tuple[int, int, int] = (0, 4, 4)

# L2ACWorld specific properties
rom_name: bytearray
Expand Down

0 comments on commit 205c6ac

Please sign in to comment.