Merge remote-tracking branch 'remotes/door_rando/DoorDev' into Dev
This commit is contained in:
11
Fill.py
11
Fill.py
@@ -192,11 +192,20 @@ def fill_restrictive(world, base_state, locations, itempool, single_player_place
|
||||
perform_access_check = not world.has_beaten_game(maximum_exploration_state, item_to_place.player) if single_player_placement else not has_beaten_game
|
||||
|
||||
spot_to_fill = None
|
||||
|
||||
for location in locations:
|
||||
if item_to_place.key: # a better test to see if a key can go there
|
||||
location.item = item_to_place
|
||||
test_state = maximum_exploration_state.copy()
|
||||
test_state.stale[item_to_place.player] = True
|
||||
else:
|
||||
test_state = maximum_exploration_state
|
||||
if (not single_player_placement or location.player == item_to_place.player)\
|
||||
and location.can_fill(maximum_exploration_state, item_to_place, perform_access_check):
|
||||
and location.can_fill(test_state, item_to_place, perform_access_check):
|
||||
spot_to_fill = location
|
||||
break
|
||||
elif item_to_place.key:
|
||||
location.item = None
|
||||
|
||||
if spot_to_fill is None:
|
||||
# we filled all reachable spots. Maybe the game can be beaten anyway?
|
||||
|
||||
Reference in New Issue
Block a user