From 8e0d2b4b88650986740e7db561bfb92f24c7fe9d Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Sun, 27 Dec 2020 04:19:12 +0100 Subject: [PATCH] Only allow opening/closing doors that are installed. --- plomrogue/tasks.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plomrogue/tasks.py b/plomrogue/tasks.py index 68ffb09..b408ea4 100644 --- a/plomrogue/tasks.py +++ b/plomrogue/tasks.py @@ -205,6 +205,8 @@ class Task_DOOR(Task): t.type_ == 'Door' and t.position in action_radius] if len(reachable_doors) == 0: raise PlayError('not standing next to a door to open/close') + if len([d for d in reachable_doors if not d.portable]) == 0: + raise PlayError('can only open/close doors that are installed') for door in reachable_doors: if not door.blocks_movement: return -- 2.30.2