From: Christian Heller Date: Sun, 27 Dec 2020 03:19:12 +0000 (+0100) Subject: Only allow opening/closing doors that are installed. X-Git-Url: https://plomlompom.com/repos/te"st.html?a=commitdiff_plain;h=8e0d2b4b88650986740e7db561bfb92f24c7fe9d;p=plomrogue2 Only allow opening/closing doors that are installed. --- 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