Browse Source

Fix issue when generating non-square DoorKey environments (#429)

Co-authored-by: Rafael Bankosegger <rafael@bankosegger.at>
rbankosegger 1 year ago
parent
commit
a7a6725aab
1 changed files with 1 additions and 1 deletions
  1. 1 1
      minigrid/envs/doorkey.py

+ 1 - 1
minigrid/envs/doorkey.py

@@ -91,7 +91,7 @@ class DoorKeyEnv(MiniGridEnv):
         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