From f906633c2b2e4040676bcca983791617201d2aea Mon Sep 17 00:00:00 2001 From: aerinon Date: Wed, 9 Aug 2023 13:30:14 -0600 Subject: [PATCH] Fix for older key drops (multidata still uses the old address calculation) --- MultiClient.py | 5 +++-- MultiServer.py | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/MultiClient.py b/MultiClient.py index df870222..a4c3b95f 100644 --- a/MultiClient.py +++ b/MultiClient.py @@ -868,7 +868,7 @@ def init_lookups(ctx): ctx.lookup_name_to_id[loc_name] = location_id ctx.lookup_id_to_name[location_id] = loc_name uw_table = DataTables.get_uw_enemy_table() - key_drop_data = {(v[1][1], v[1][2]): k for k, v in PotShuffle.key_drop_data.items() if v[1] == 'Drop'} + key_drop_data = {(v[1][1], v[1][2]): k for k, v in PotShuffle.key_drop_data.items() if v[0] == 'Drop'} for super_tile, enemy_list in uw_table.room_map.items(): index_adj = 0 for index, sprite in enumerate(enemy_list): @@ -877,12 +877,13 @@ def init_lookups(ctx): continue if (super_tile, index) in key_drop_data: loc_name = key_drop_data[(super_tile, index)] + location_id = PotShuffle.key_drop_data[loc_name][1][0] else: loc_name = f'{sprite.region} Enemy #{index+1}' + location_id = EnemyList.drop_address(index, super_tile) if index < index_adj: logging.info(f'Problem at {hex(super_tile)} {loc_name}') location_table_sprite_items[loc_name] = (2 * super_tile, 0x8000 >> (index-index_adj)) - location_id = EnemyList.drop_address(index, super_tile) ctx.lookup_name_to_id[loc_name] = location_id ctx.lookup_id_to_name[location_id] = loc_name diff --git a/MultiServer.py b/MultiServer.py index 7040ce27..c92f9989 100644 --- a/MultiServer.py +++ b/MultiServer.py @@ -370,14 +370,15 @@ def init_lookups(ctx): ctx.lookup_name_to_id[loc_name] = location_id ctx.lookup_id_to_name[location_id] = loc_name uw_table = DataTables.get_uw_enemy_table() - key_drop_data = {(v[1][1], v[1][2]): k for k, v in PotShuffle.key_drop_data.items() if v[1] == 'Drop'} + key_drop_data = {(v[1][1], v[1][2]): k for k, v in PotShuffle.key_drop_data.items() if v[0] == 'Drop'} for super_tile, enemy_list in uw_table.room_map.items(): for index, sprite in enumerate(enemy_list): if (super_tile, index) in key_drop_data: loc_name = key_drop_data[(super_tile, index)] + location_id = PotShuffle.key_drop_data[loc_name][1][0] else: loc_name = f'{sprite.region} Enemy #{index+1}' - location_id = EnemyList.drop_address(index, super_tile) + location_id = EnemyList.drop_address(index, super_tile) ctx.lookup_name_to_id[loc_name] = location_id ctx.lookup_id_to_name[location_id] = loc_name