diff nagslang/screens/area.py @ 279:9f68e22c1e58

Don't crash on empty walls
author Neil Muller <drnlmuller@gmail.com>
date Thu, 05 Sep 2013 13:47:22 +0200
parents 56e42c00da25
children 9b56e954c674
line wrap: on
line diff
--- a/nagslang/screens/area.py	Thu Sep 05 13:34:37 2013 +0200
+++ b/nagslang/screens/area.py	Thu Sep 05 13:47:22 2013 +0200
@@ -101,6 +101,9 @@
         body.position = (0, 0)
         walls = self._level.get_walls()
         for wall in walls:
+            if len(wall) < 2:
+                # Don't try to add a useless wall
+                continue
             corners = wall
             corner = corners[-1]
             for next_corner in corners: