Skip to content

Commit b19a6c8

Browse files
committed
Merge 'Fix NameError with vanilla special deal prices' (#2534)
2 parents abc5e9c + e435c15 commit b19a6c8

3 files changed

Lines changed: 9 additions & 5 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
* Added some missing or incorrectly named locations in advanced logic.
2424
* Various minor fixes for advanced logic.
2525
* Fix for advanced logic tricks being cached when switching to glitchless logic.
26+
* Fix for failure to generate when special deal prices are set to vanilla.
2627

2728
## Other Changes
2829
* It is no longer required to have either the goron tunic or the Fewer Tunic Requirements trick for adult to go from the Bolero warp pad to the Fire temple in logic.

World.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -704,11 +704,14 @@ def random_shop_prices(self) -> None:
704704
for location in region.locations:
705705
if location.type == 'Shop':
706706
if location.name[-1:] in shop_item_indexes[:shop_item_count]:
707-
self.shop_prices[location.name] = self.new_shop_price()
707+
self.shop_prices[location.name] = self.new_shop_price(location)
708708

709-
def new_shop_price(self) -> int:
709+
def new_shop_price(self, location: Location) -> int:
710710
if self.settings.special_deal_price_distribution == 'vanilla':
711-
return ItemInfo.items[location.vanilla_item].price
711+
price = location.price
712+
if price is None:
713+
price = ItemInfo.items[location.vanilla_item].price
714+
return price
712715
elif self.settings.special_deal_price_max < self.settings.special_deal_price_min:
713716
raise ValueError('Maximum special deal price is lower than minimum, perhaps you meant to swap them?')
714717
elif self.settings.special_deal_price_max == self.settings.special_deal_price_min:
@@ -1226,7 +1229,7 @@ def push_item(self, location: str | Location, item: Item, manual: bool = False)
12261229
# Reduce the frequency of obvious scams by rerolling the price once if it's too high, and taking the lower value.
12271230
# This affects logic so it should only be applied to refills that are logically irrelevant.
12281231
# Otherwise there could be seeds with e.g. a wallet that's hinted as logically required for a purchase even though the price was rerolled to no longer require the wallet.
1229-
price = min(location.price, self.new_shop_price())
1232+
price = min(location.price, self.new_shop_price(location))
12301233
else:
12311234
price = item.price
12321235

version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = '9.0.34'
1+
__version__ = '9.0.35'
22

33
# This is a supplemental version number for branches based off of main dev.
44
supplementary_version = 0

0 commit comments

Comments
 (0)