diff options
author | Haru <haru@dotalux.com> | 2016-08-22 02:47:18 +0200 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2016-08-22 03:32:50 +0200 |
commit | 7174ca99be7f0113cb17bf9cb13eba50e4539fc0 (patch) | |
tree | dd76d8671a4b3ef84678996b0dad366ea345f51a | |
parent | d4266fb10d2557cfd3f56356ce867f16c86107cc (diff) | |
download | hercules-7174ca99be7f0113cb17bf9cb13eba50e4539fc0.tar.gz hercules-7174ca99be7f0113cb17bf9cb13eba50e4539fc0.tar.bz2 hercules-7174ca99be7f0113cb17bf9cb13eba50e4539fc0.tar.xz hercules-7174ca99be7f0113cb17bf9cb13eba50e4539fc0.zip |
Corrected an issue that caused the setting char_configuration/permission/display_new to be ignored
Fixes #1407
Signed-off-by: Haru <haru@dotalux.com>
-rw-r--r-- | src/char/char.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/char/char.c b/src/char/char.c index 126ddc149..952c3d781 100644 --- a/src/char/char.c +++ b/src/char/char.c @@ -5982,7 +5982,12 @@ bool char_config_read_permission(const char *filename, const struct config_t *co } libconfig->setting_lookup_bool_real(setting, "enable_char_creation", &enable_char_creation); - libconfig->setting_lookup_int16(setting, "display_new", &chr->new_display); + if (libconfig->setting_lookup_int16(setting, "display_new", &chr->new_display) != CONFIG_TRUE) { + // While normally true/false makes sense, we may accept any int16 here (it's passed as is to the client) + int i32 = 0; + if (libconfig->setting_lookup_bool(setting, "display_new", &i32) == CONFIG_TRUE) + chr->new_display = i32 == 0 ? 0 : 1; + } libconfig->setting_lookup_int(setting, "max_connect_user", &max_connect_user); libconfig->setting_lookup_int(setting, "gm_allow_group", &gm_allow_group); libconfig->setting_lookup_int(setting, "maintenance_min_group_id", &char_maintenance_min_group_id); |