Skip to content

Commit

Permalink
fix: ensure first exit is up or right (#177)
Browse files Browse the repository at this point in the history
Fixes #24
  • Loading branch information
Jeremy-Vidaurri authored Sep 5, 2024
1 parent 9f913be commit 068e7c2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Randomizer/RandoLogic/LogicPathway.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,11 @@ public override bool Next()
{
var caps = this.Logic.Caps.WithoutFlags();
var closure = LinkedNodeSet.Closure(this.Node, caps, null, true);
var available = closure.UnlinkedEdges(u => !this.TriedEdges.Contains(u.Static) && (u.Static.HoleTarget == null || (!this.ForceWarp && this.Logic.Map.HoleFree(this.Node.Room, u.Static.HoleTarget))));
var available = closure.UnlinkedEdges(u => {
// ensure first hole is up or right
var flag = this.Logic.CompletedTasks.Count != 1 || (u.Static.HoleTarget.Side != ScreenDirection.Down && u.Static.HoleTarget.Side != ScreenDirection.Left);
return !this.TriedEdges.Contains(u.Static) && (u.Static.HoleTarget == null || (!this.ForceWarp && this.Logic.Map.HoleFree(this.Node.Room, u.Static.HoleTarget) && flag));
});
if (available.Count == 0)
{
Logger.Log("randomizer", $"Failure: No edges out of {Node.Room.Static.Name}:{Node.Static.Name}");
Expand Down

0 comments on commit 068e7c2

Please sign in to comment.