Skip to content

Commit 4043e74

Browse files
committed
Fix BlockersAnywhere off removing all spell required rooms
The magic containers are not part of the allowed blockers, so the check implicit requirements check had to be off.
1 parent abbba4b commit 4043e74

2 files changed

Lines changed: 3 additions & 15 deletions

File tree

RandomizerCore/Sidescroll/Room.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,9 +418,9 @@ public string PrintUnsatisfiedExits()
418418
}
419419
return sb.ToString();
420420
}
421-
public bool IsTraversable(IEnumerable<RequirementType> requireables)
421+
public bool IsTraversable(IEnumerable<RequirementType> requireables, bool enforceImplicitRequirements = true)
422422
{
423-
return Requirements.AreSatisfiedBy(requireables);
423+
return Requirements.AreSatisfiedBy(requireables, enforceImplicitRequirements);
424424
}
425425

426426
public string GetDebuggerDisplay()

RandomizerCore/Sidescroll/RoomPool.cs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -266,19 +266,7 @@ public RoomPool(PalaceRooms palaceRooms, int palaceNumber, RandomizerProperties
266266
if (!props.BlockersAnywhere)
267267
{
268268
RequirementType[] allowedBlockers = Palaces.ALLOWED_BLOCKERS_BY_PALACE[palaceNumber - 1];
269-
RemoveRooms(room => !room.IsTraversable(allowedBlockers));
270-
foreach (var key in ItemRoomsByDirection.Keys)
271-
{
272-
List<(Room, int)> updatedWeights = [];
273-
foreach (Room room in ItemRoomsByDirection[key].Keys())
274-
{
275-
if (room.IsTraversable(allowedBlockers))
276-
{
277-
updatedWeights.Add((room, ItemRoomsByDirection[key].Weight(room)));
278-
}
279-
}
280-
ItemRoomsByDirection[key] = new TableWeightedRandom<Room>(updatedWeights);
281-
}
269+
RemoveRooms(room => !room.IsTraversable(allowedBlockers, false));
282270
}
283271
}
284272

0 commit comments

Comments
 (0)