prevent script error for Loc_Area(nil) call

shapetextures
Maikel de Vries 2015-09-06 11:24:43 +02:00
parent 88eaba77e9
commit b20ec03832
1 changed files with 2 additions and 0 deletions

View File

@ -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);
}