Browse Source

key persistence (#44)

* keys no longer disappear after they are used to unlock a door

* and remove the comment as well
Dzmitry Bahdanau 6 years ago
parent
commit
5f001235c4
1 changed files with 0 additions and 2 deletions
  1. 0 2
      gym_minigrid/minigrid.py

+ 0 - 2
gym_minigrid/minigrid.py

@@ -233,8 +233,6 @@ class Door(WorldObj):
             if isinstance(env.carrying, Key) and env.carrying.color == self.color:
             if isinstance(env.carrying, Key) and env.carrying.color == self.color:
                 self.is_locked = False
                 self.is_locked = False
                 self.is_open = True
                 self.is_open = True
-                # The key has been used, remove it from the agent
-                env.carrying = None
                 return True
                 return True
             return False
             return False