From 2447be92d83f478be9952110c2ac5d80cc80ea1f Mon Sep 17 00:00:00 2001 From: Aaron Wagener Date: Fri, 17 May 2024 03:18:50 -0500 Subject: [PATCH] The Messenger: fix generation failure for no portal shuffle with 3 available portals (#3200) --- worlds/messenger/__init__.py | 3 ++- worlds/messenger/test/test_portals.py | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/worlds/messenger/__init__.py b/worlds/messenger/__init__.py index 21a2fa6e..a03c33c2 100644 --- a/worlds/messenger/__init__.py +++ b/worlds/messenger/__init__.py @@ -155,7 +155,8 @@ class MessengerWorld(World): self.starting_portals.append("Searing Crags Portal") portals_to_strip = [portal for portal in ["Riviere Turquoise Portal", "Sunken Shrine Portal"] if portal in self.starting_portals] - self.starting_portals.remove(self.random.choice(portals_to_strip)) + if portals_to_strip: + self.starting_portals.remove(self.random.choice(portals_to_strip)) self.filler = FILLER.copy() if self.options.traps: diff --git a/worlds/messenger/test/test_portals.py b/worlds/messenger/test/test_portals.py index 6ebb1838..b1875ac0 100644 --- a/worlds/messenger/test/test_portals.py +++ b/worlds/messenger/test/test_portals.py @@ -4,6 +4,10 @@ from ..portals import PORTALS class PortalTestBase(MessengerTestBase): + options = { + "available_portals": 3, + } + def test_portal_reqs(self) -> None: """tests the paths to open a portal if only that portal is closed with vanilla connections.""" # portal and requirements to reach it if it's the only closed portal