diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-02-14 01:54:34 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-02-14 02:42:36 +0300 |
commit | 388961002f81f1e8ddd5343c54d510af0ad5bdc6 (patch) | |
tree | b9ba33ddd0de676d9bd4f9edc19684b43e00b564 /src/emap/itemdb.c | |
parent | 4bf7ac022dd4baf2ddca750971ecd2853979a40c (diff) | |
download | evol-hercules-388961002f81f1e8ddd5343c54d510af0ad5bdc6.tar.gz evol-hercules-388961002f81f1e8ddd5343c54d510af0ad5bdc6.tar.bz2 evol-hercules-388961002f81f1e8ddd5343c54d510af0ad5bdc6.tar.xz evol-hercules-388961002f81f1e8ddd5343c54d510af0ad5bdc6.zip |
Add support for item attribute MaxFloorOffset.
Change plugin version to 12.
Diffstat (limited to 'src/emap/itemdb.c')
-rw-r--r-- | src/emap/itemdb.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/emap/itemdb.c b/src/emap/itemdb.c index 63434bf..5fcc86b 100644 --- a/src/emap/itemdb.c +++ b/src/emap/itemdb.c @@ -86,6 +86,32 @@ void eitemdb_readdb_additional_fields(int *itemid, data->requiredSkill = i32; if (libconfig->setting_lookup_bool(it, "Charm", &i32) && i32 >= 0) data->charmItem = i32 ? true : false; + if ((t = libconfig->setting_get_member(it, "MaxFloorOffset"))) + { + if (config_setting_is_aggregate(t)) + { + data->subX = libconfig->setting_get_int_elem(t, 0); + if (libconfig->setting_length(t) >= 2) + data->subY = libconfig->setting_get_int_elem(t, 1); + else if (libconfig->setting_length(t) >= 1) + data->subY = data->subX; + } + else if (libconfig->setting_lookup_int(it, "MaxFloorOffset", &i32)) + { + data->subX = i32; + data->subY = i32; + } + if (data->subX < 0 || data->subX > 127) + { + ShowWarning("Field MaxFloorOffsetX for item %s must be in range 0-127\n", item->name); + data->subX = 8; + } + if (data->subY < 0 || data->subY > 127) + { + ShowWarning("Field MaxFloorOffsetY for item %s must be in range 0-127\n", item->name); + data->subY = 8; + } + } if (itemdb->lookup_const(it, "UseEffect", &i32)) data->useEffect = i32; |