home · contact · privacy
Only allow opening/closing doors that are installed.
authorChristian Heller <c.heller@plomlompom.de>
Sun, 27 Dec 2020 03:19:12 +0000 (04:19 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Sun, 27 Dec 2020 03:19:12 +0000 (04:19 +0100)
plomrogue/tasks.py

index 68ffb09d203055f4e2bd32126d1c609d103517be..b408ea49636b582a3dcbe8fd505faa196270fe99 100644 (file)
@@ -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')
                            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
         for door in reachable_doors:
             if not door.blocks_movement:
                 return