General coding pass on Shops

This commit is contained in:
Fabian Dill
2021-01-18 04:48:20 +01:00
parent a67d657882
commit 478e1f3a82
2 changed files with 74 additions and 62 deletions

6
Rom.py
View File

@@ -1572,9 +1572,9 @@ def write_custom_shops(rom, world, player):
for item in shop.inventory:
if item is None:
break
item_data = [shop_id, ItemFactory(item['item'], player).code] + int16_as_bytes(item['price']) + [ item['max'],\
ItemFactory(item['replacement'], player).code if item['replacement'] else 0xFF] + int16_as_bytes(
item['replacement_price']) + [item['player']]
item_data = [shop_id, ItemFactory(item['item'], player).code] + int16_as_bytes(item['price']) + \
[item['max'], ItemFactory(item['replacement'], player).code if item['replacement'] else 0xFF] + \
int16_as_bytes(item['replacement_price']) + [0 if item['player'] == player else item['player']]
items_data.extend(item_data)
rom.write_bytes(0x184800, shop_data)