From b20ec03832f814970de20573469ba3a2c13ca696 Mon Sep 17 00:00:00 2001 From: Maikel de Vries Date: Sun, 6 Sep 2015 11:24:43 +0200 Subject: [PATCH] prevent script error for Loc_Area(nil) call --- planet/System.ocg/FindLocation.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/planet/System.ocg/FindLocation.c b/planet/System.ocg/FindLocation.c index 469c0132a..2773213f5 100644 --- a/planet/System.ocg/FindLocation.c +++ b/planet/System.ocg/FindLocation.c @@ -77,6 +77,7 @@ only returns results in area defined by a proplist */ global func Loc_InArea(a) { + if (a == nil) return [LOC_INVALID]; return[LOC_INAREA, a]; } @@ -274,6 +275,7 @@ global func FindLocationConditionCheckIsValid(flag, x, y) if (flag[0] == LOC_INAREA) { var area = flag[1]; + area = area ?? Shape->LandscapeRectangle(); return area->IsPointContained(x, y); }