summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/map/script.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/map/script.c b/src/map/script.c
index cf2a0c2d1..8a9236d34 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -11645,6 +11645,13 @@ static BUILDIN(getunits)
const char *mapname = script_getstr(st, 5);
int16 m = map->mapname2mapid(mapname);
+ if (m == -1) {
+ ShowError("script:getunits: Invalid map(%s) provided.\n", mapname);
+ script->reportdata(data);
+ st->state = END;
+ return false;
+ }
+
if (script_hasdata(st, 9)) {
int16 x1 = script_getnum(st, 6);
int16 y1 = script_getnum(st, 7);