summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2013-11-16 16:22:24 +0100
committerHaru <haru@dotalux.com>2013-11-16 16:27:03 +0100
commit4943bc87d899cdc42029a841ff609ebeb55ae489 (patch)
tree4b76b20da8cfc230363bff9f5ab92ab824be55d4 /src
parentd1a635a06f5152b51d0879176f011b5c6e45431c (diff)
downloadhercules-4943bc87d899cdc42029a841ff609ebeb55ae489.tar.gz
hercules-4943bc87d899cdc42029a841ff609ebeb55ae489.tar.bz2
hercules-4943bc87d899cdc42029a841ff609ebeb55ae489.tar.xz
hercules-4943bc87d899cdc42029a841ff609ebeb55ae489.zip
Fixed a mapserver crash when using SQL item DB and an item's script is NULL
- Special thanks to Mumbles. Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src')
-rw-r--r--src/map/itemdb.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/map/itemdb.c b/src/map/itemdb.c
index 8eb9c0f14..51986fcf6 100644
--- a/src/map/itemdb.c
+++ b/src/map/itemdb.c
@@ -1679,9 +1679,9 @@ int itemdb_readdb_sql_sub(Sql *handle, int n, const char *source) {
SQL->GetData(handle, 19, &data, NULL); id.flag.no_refine = data && atoi(data) ? 0 : 1;
SQL->GetData(handle, 20, &data, NULL); id.look = data ? atoi(data) : 0;
SQL->GetData(handle, 21, &data, NULL); id.flag.bindonequip = data && atoi(data) ? 1 : 0;
- SQL->GetData(handle, 22, &data, NULL); id.script = *data ? script->parse(data, source, -id.nameid, SCRIPT_IGNORE_EXTERNAL_BRACKETS) : NULL;
- SQL->GetData(handle, 23, &data, NULL); id.equip_script = *data ? script->parse(data, source, -id.nameid, SCRIPT_IGNORE_EXTERNAL_BRACKETS) : NULL;
- SQL->GetData(handle, 24, &data, NULL); id.unequip_script = *data ? script->parse(data, source, -id.nameid, SCRIPT_IGNORE_EXTERNAL_BRACKETS) : NULL;
+ SQL->GetData(handle, 22, &data, NULL); id.script = data && *data ? script->parse(data, source, -id.nameid, SCRIPT_IGNORE_EXTERNAL_BRACKETS) : NULL;
+ SQL->GetData(handle, 23, &data, NULL); id.equip_script = data && *data ? script->parse(data, source, -id.nameid, SCRIPT_IGNORE_EXTERNAL_BRACKETS) : NULL;
+ SQL->GetData(handle, 24, &data, NULL); id.unequip_script = data && *data ? script->parse(data, source, -id.nameid, SCRIPT_IGNORE_EXTERNAL_BRACKETS) : NULL;
return itemdb->validate_entry(&id, n, source);
}