summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-01-24 00:12:57 +0300
committerAndrei Karas <akaras@inbox.ru>2016-01-24 00:12:57 +0300
commit207e14ad4c4efe77e258efc55b09ccbf1c66845c (patch)
tree1630c462518750ceb5701847a8d70256b1965c1d /src
parent5a8d6081f975536713974eccd0ed2371c8909495 (diff)
downloadevol-hercules-207e14ad4c4efe77e258efc55b09ccbf1c66845c.tar.gz
evol-hercules-207e14ad4c4efe77e258efc55b09ccbf1c66845c.tar.bz2
evol-hercules-207e14ad4c4efe77e258efc55b09ccbf1c66845c.tar.xz
evol-hercules-207e14ad4c4efe77e258efc55b09ccbf1c66845c.zip
Dont search name in scripts for items with id 0.
Diffstat (limited to 'src')
-rw-r--r--src/emap/script.c7
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)