Fix: Multiple right doors are classified as left and right doors

This commit is contained in:
LmeSzinc 2024-05-14 02:45:12 +08:00
parent caf3af9973
commit 5f9ec0ed57

View File

@ -253,8 +253,17 @@ class RogueExit(CombatInteract):
else:
return None, results[0].matched_keyword
else:
results = [r for d, r in sorted(zip(directions, results))]
return results[0].matched_keyword, results[-1].matched_keyword
left = [r for d, r in sorted(zip(directions, results)) if d < 0]
right = [r for d, r in sorted(zip(directions, results)) if d >= 0]
if len(left):
left = left[0].matched_keyword
else:
left = None
if len(right):
right = right[-1].matched_keyword
else:
right = None
return left, right
def choose_door(self, left_door: MapPlane | None, right_door: MapPlane | None) -> str | None:
"""