diff options
author | Asheraf <acheraf1998@gmail.com> | 2019-11-04 17:00:12 +0100 |
---|---|---|
committer | Asheraf <acheraf1998@gmail.com> | 2019-11-06 17:13:37 +0100 |
commit | 76ccfbd19e9cb96fdfd0627f1a8f6493ed960c0b (patch) | |
tree | 44f2bc189a14c437d9360f6d27382cf7d4c2fa2f /src/map | |
parent | 857650c4f58d347455b0d075b49a53f69e6d0c51 (diff) | |
download | hercules-76ccfbd19e9cb96fdfd0627f1a8f6493ed960c0b.tar.gz hercules-76ccfbd19e9cb96fdfd0627f1a8f6493ed960c0b.tar.bz2 hercules-76ccfbd19e9cb96fdfd0627f1a8f6493ed960c0b.tar.xz hercules-76ccfbd19e9cb96fdfd0627f1a8f6493ed960c0b.zip |
Add support for defining status icons in the sc config
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/status.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/map/status.c b/src/map/status.c index d2c67b84e..1d856a4a3 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -13458,19 +13458,24 @@ static bool status_read_scdb_libconfig_sub(struct config_setting_t *it, int idx, nullpo_retr(false, source); int i32; + int status_id; const char *name = config_setting_name(it); - if (!script->get_constant(name, &i32) || i32 <= SC_NONE || i32 >= SC_MAX) { + if (!script->get_constant(name, &status_id) || status_id <= SC_NONE || status_id >= SC_MAX) { ShowWarning("status_read_scdb_libconfig_sub: Invalid status type (%s) in \"%s\" entry #%d, skipping.\n", name, source, idx); return false; } - libconfig->setting_lookup_bool_real(it, "Visible", &status->dbs->DisplayType[i32]); + libconfig->setting_lookup_bool_real(it, "Visible", &status->dbs->DisplayType[status_id]); struct config_setting_t *fg = libconfig->setting_get_member(it, "Flags"); if (fg != NULL) - status->read_scdb_libconfig_sub_flag(fg, i32, source); + status->read_scdb_libconfig_sub_flag(fg, status_id, source); + if (itemdb->lookup_const(it, "Icon", &i32) && i32 >= 0) + status->dbs->IconChangeTable[status_id] = i32; + else + status->dbs->IconChangeTable[status_id] = SI_BLANK; return true; } |