Don't try running a hitTest against non-interactive WayUIs
authorRichard Fairhurst <richard@systemeD.net>
Tue, 6 Mar 2012 17:22:45 +0000 (17:22 +0000)
committerRichard Fairhurst <richard@systemeD.net>
Tue, 6 Mar 2012 17:22:45 +0000 (17:22 +0000)
net/systemeD/halcyon/WayUI.as

index a7e101d..f7a5945 100644 (file)
@@ -615,7 +615,7 @@ package net.systemeD.halcyon {
                /* Interaction */
         // TODO: can this be sped up? Hit testing for long ways (that go off the screen) seems to be very slow. */
                public function hitTest(x:Number, y:Number):Way {
-                       if (hitzone.hitTestPoint(x,y,true)) { return entity as Way; }
+                       if (hitzone && hitzone.hitTestPoint(x,y,true)) { return entity as Way; }
                        return null;
                }
        }