From 207e14ad4c4efe77e258efc55b09ccbf1c66845c Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 24 Jan 2016 00:12:57 +0300 Subject: Dont search name in scripts for items with id 0. --- src/emap/script.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/emap/script.c b/src/emap/script.c index 9d89fc7..1df6d0a 100644 --- a/src/emap/script.c +++ b/src/emap/script.c @@ -543,7 +543,8 @@ BUILDIN(getItemLink) else { item_id = script_getnum (st, 2); - i_data = itemdb->search (item_id); + if (item_id) + i_data = itemdb->search (item_id); } item_name = (char *) aCalloc (100, sizeof (char)); @@ -1964,7 +1965,9 @@ BUILDIN(getInvIndexLink) } const int item_id = sd->status.inventory[index].nameid; - const struct item_data *const i_data = itemdb->search(item_id); + const struct item_data *i_data = NULL; + if (item_id) + i_data = itemdb->search(item_id); char *const item_name = (char *) aCalloc (1000, sizeof (char)); if (sd) -- cgit v1.2.3-70-g09d2