From a7a6725aabd3d2a4e9edf6b11739208efe1d5520 Mon Sep 17 00:00:00 2001 From: rbankosegger Date: Mon, 22 Apr 2024 16:45:44 +0200 Subject: [PATCH] Fix issue when generating non-square DoorKey environments (#429) Co-authored-by: Rafael Bankosegger --- 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