diff options
author | Haru <haru@dotalux.com> | 2013-11-16 16:22:24 +0100 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2013-11-16 16:27:03 +0100 |
commit | 4943bc87d899cdc42029a841ff609ebeb55ae489 (patch) | |
tree | 4b76b20da8cfc230363bff9f5ab92ab824be55d4 /src | |
parent | d1a635a06f5152b51d0879176f011b5c6e45431c (diff) | |
download | hercules-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.c | 6 |
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); } |