Noita: Fix filling Shop Item locations without updating item.location (#5840)

In single-player multiworlds with small item pools, Noita was manually
placing some items into Shop Item locations, but was only setting
location.item, and not also setting item.location so that the item and
location refer to one another.

This has been fixed by using the MultiWorld.push_item() helper method to
place the items instead of manually placing the items.
This commit is contained in:
Mysteryem
2026-01-18 13:47:55 +00:00
committed by GitHub
parent 20c10e33c4
commit a035ac579c

View File

@@ -79,7 +79,7 @@ def create_all_items(world: NoitaWorld) -> None:
if world.multiworld.players == 1: if world.multiworld.players == 1:
for location in world.multiworld.get_unfilled_locations(player): for location in world.multiworld.get_unfilled_locations(player):
if "Shop Item" in location.name: if "Shop Item" in location.name:
location.item = create_item(player, itempool.pop()) world.multiworld.push_item(location, create_item(player, itempool.pop()), False)
locations_to_fill = len(world.multiworld.get_unfilled_locations(player)) locations_to_fill = len(world.multiworld.get_unfilled_locations(player))
itempool += create_random_items(world, filler_weights, locations_to_fill - len(itempool)) itempool += create_random_items(world, filler_weights, locations_to_fill - len(itempool))