lufia2ac: prevent 0 byte reads (#3168)
This commit is contained in:
parent
6e56f31398
commit
52c1b04fc8
|
@ -118,6 +118,7 @@ class L2ACSNIClient(SNIClient):
|
||||||
snes_buffered_write(ctx, L2AC_TX_ADDR + 8, total_blue_chests_checked.to_bytes(2, "little"))
|
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)]
|
location_ids: List[int] = [locations_start_id + i for i in range(total_blue_chests_checked)]
|
||||||
|
|
||||||
|
if snes_other_locations_checked:
|
||||||
loc_data: Optional[bytes] = await snes_read(ctx, L2AC_TX_ADDR + 32, snes_other_locations_checked * 2)
|
loc_data: Optional[bytes] = await snes_read(ctx, L2AC_TX_ADDR + 32, snes_other_locations_checked * 2)
|
||||||
if loc_data is not None:
|
if loc_data is not None:
|
||||||
location_ids.extend(locations_start_id + int.from_bytes(loc_data[2 * i:2 * i + 2], "little")
|
location_ids.extend(locations_start_id + int.from_bytes(loc_data[2 * i:2 * i + 2], "little")
|
||||||
|
|
Loading…
Reference in New Issue