diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-01-24 00:12:57 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-01-24 00:12:57 +0300 |
commit | 207e14ad4c4efe77e258efc55b09ccbf1c66845c (patch) | |
tree | 1630c462518750ceb5701847a8d70256b1965c1d /src/emap/script.c | |
parent | 5a8d6081f975536713974eccd0ed2371c8909495 (diff) | |
download | plugin-207e14ad4c4efe77e258efc55b09ccbf1c66845c.tar.gz plugin-207e14ad4c4efe77e258efc55b09ccbf1c66845c.tar.bz2 plugin-207e14ad4c4efe77e258efc55b09ccbf1c66845c.tar.xz plugin-207e14ad4c4efe77e258efc55b09ccbf1c66845c.zip |
Dont search name in scripts for items with id 0.
Diffstat (limited to 'src/emap/script.c')
-rw-r--r-- | src/emap/script.c | 7 |
1 files changed, 5 insertions, 2 deletions
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) |