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 <house.bad@gmail.com>
This commit is contained in:
Cydh Ramdh 2014-12-19 13:01:12 +07:00
parent 09b0898e60
commit 1e6e3f4df3

View File

@ -19120,7 +19120,7 @@ BUILDIN_FUNC(countspiritball) {
*/ */
BUILDIN_FUNC(mergeitem) { BUILDIN_FUNC(mergeitem) {
struct map_session_data *sd = script_rid2sd(st); struct map_session_data *sd = script_rid2sd(st);
struct item *items; struct item *items = NULL;
uint16 i, count = 0; uint16 i, count = 0;
int nameid = 0; int nameid = 0;
@ -19180,6 +19180,9 @@ BUILDIN_FUNC(mergeitem) {
} }
} }
if (!items) // Nothing todo here
return SCRIPT_CMD_SUCCESS;
// Retrieve the items // Retrieve the items
for (i = 0; i < count; i++) { for (i = 0; i < count; i++) {
uint8 flag = 0; uint8 flag = 0;