Skip to content

Commit

Permalink
Follow up 5ce8055
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
cydh committed Dec 19, 2014
1 parent 09b0898 commit 1e6e3f4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/map/script.c
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 1e6e3f4

Please sign in to comment.