From 1e6e3f4df36bd85d1c411a38a3e4d8c319240b1d Mon Sep 17 00:00:00 2001 From: Cydh Ramdh Date: Fri, 19 Dec 2014 13:01:12 +0700 Subject: [PATCH] Follow up 5ce8055 * Added safe check if `mergeitem` script command being used with no items to be merged. Thank @RadianFord Signed-off-by: Cydh Ramdh --- src/map/script.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/map/script.c b/src/map/script.c index de48e629ee..b242126bef 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -19120,7 +19120,7 @@ BUILDIN_FUNC(countspiritball) { */ BUILDIN_FUNC(mergeitem) { struct map_session_data *sd = script_rid2sd(st); - struct item *items; + struct item *items = NULL; uint16 i, count = 0; int nameid = 0; @@ -19180,6 +19180,9 @@ BUILDIN_FUNC(mergeitem) { } } + if (!items) // Nothing todo here + return SCRIPT_CMD_SUCCESS; + // Retrieve the items for (i = 0; i < count; i++) { uint8 flag = 0;