From 9b8f7b7c9ca28f2ec19a0040e64dd4d3de13f3da Mon Sep 17 00:00:00 2001 From: Rafael Bankosegger Date: Mon, 22 Apr 2024 15:09:01 +0200 Subject: [PATCH] Fix issue when generating non-square DoorKey environments (#427) --- minigrid/envs/doorkey.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/minigrid/envs/doorkey.py b/minigrid/envs/doorkey.py index 39724968f..43c07f840 100644 --- a/minigrid/envs/doorkey.py +++ b/minigrid/envs/doorkey.py @@ -91,7 +91,7 @@ def _gen_grid(self, width, height): self.place_agent(size=(splitIdx, height)) # Place a door in the wall - doorIdx = self._rand_int(1, width - 2) + doorIdx = self._rand_int(1, height - 2) self.put_obj(Door("yellow", is_locked=True), splitIdx, doorIdx) # Place a yellow key on the left side