Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LADX: Fix generation error on minimal accessibility #4281

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 17 additions & 5 deletions worlds/ladx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import bsdiff4

import settings
from BaseClasses import Entrance, Item, ItemClassification, Location, Tutorial, MultiWorld
from BaseClasses import CollectionState, Entrance, Item, ItemClassification, Location, Tutorial, MultiWorld
from Fill import fill_restrictive
from worlds.AutoWorld import WebWorld, World
from .Common import *
Expand Down Expand Up @@ -362,13 +362,25 @@ def priority(item):
all_dungeon_items_to_fill.sort(key=priority)

# Set up state
all_state = self.multiworld.get_all_state(use_cache=False)
partial_all_state = CollectionState(self.multiworld)
# Collect every item from the item pool and every pre-fill item like MultiWorld.get_all_state, but don't sweep.
for item in self.multiworld.itempool:
partial_all_state.collect(item, prevent_sweep=True)
for player in self.multiworld.player_ids:
subworld = self.multiworld.worlds[player]
for item in subworld.get_pre_fill_items():
partial_all_state.collect(item, prevent_sweep=True)
# get_all_state would normally sweep here, but we need to remove our dungeon items first.

# Remove dungeon items we are about to put in from the state so that we don't double count
for item in all_dungeon_items_to_fill:
all_state.remove(item)
partial_all_state.remove(item)

# Sweep to pick up already placed items that are reachable with everything but the dungeon items.
partial_all_state.sweep_for_advancements()

# Finally, fill!
fill_restrictive(self.multiworld, all_state, all_dungeon_locs_to_fill, all_dungeon_items_to_fill, lock=True, single_player_placement=True, allow_partial=False)
fill_restrictive(self.multiworld, partial_all_state, all_dungeon_locs_to_fill, all_dungeon_items_to_fill, lock=True, single_player_placement=True, allow_partial=False)


name_cache = {}
# Tries to associate an icon from another game with an icon we have
Expand Down
Loading