From 11782a7183707e8e0a3ed6f6e183ccaf4a6de74d Mon Sep 17 00:00:00 2001 From: mekolat Date: Mon, 25 Apr 2016 15:44:09 -0400 Subject: allow setarray and cleararray to have no block list --- src/map/script-fun.cpp | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'src/map') diff --git a/src/map/script-fun.cpp b/src/map/script-fun.cpp index 6b9f9a7..7379600 100644 --- a/src/map/script-fun.cpp +++ b/src/map/script-fun.cpp @@ -1465,12 +1465,13 @@ void builtin_setarray(ScriptState *st) j = getarraysize2(reg, bl); } else if (prefix != '$' && !name.startswith(".@"_s)) - bl = map_id_is_player(st->rid); - - if (!bl) { - PRINTF("builtin_setarray: rid not attached\n"_fmt); - return; + bl = map_id_is_player(st->rid); + if (!bl) + { + PRINTF("builtin_setarray: rid not attached\n"_fmt); + return; + } } for (; i < st->end - st->start - 2 && j < 256; i++, j++) @@ -1506,12 +1507,13 @@ void builtin_cleararray(ScriptState *st) if (prefix == '.' && !name.startswith(".@"_s)) bl = map_id_is_npc(st->oid); else if (prefix != '$' && !name.startswith(".@"_s)) - bl = map_id_is_player(st->rid); - - if (!bl) { - PRINTF("builtin_cleararray: no block list\n"_fmt); - return; + bl = map_id_is_player(st->rid); + if (!bl) + { + PRINTF("builtin_cleararray: no block list\n"_fmt); + return; + } } for (int i = 0; i < sz; i++) -- cgit v1.2.3-60-g2f50