diff options
author | gumi <git@gumi.ca> | 2017-10-20 15:13:43 -0400 |
---|---|---|
committer | gumi <git@gumi.ca> | 2018-10-22 11:12:24 -0400 |
commit | 71378dd896ac0ff839091a0c3ccca5abab20cda5 (patch) | |
tree | ffcc56dcbe1b9646033cc9915d0e579a9ef80ac5 /src/char | |
parent | 1f7d4f00a52a6b32981ef54fb4a5514ece6f75df (diff) | |
download | hercules-71378dd896ac0ff839091a0c3ccca5abab20cda5.tar.gz hercules-71378dd896ac0ff839091a0c3ccca5abab20cda5.tar.bz2 hercules-71378dd896ac0ff839091a0c3ccca5abab20cda5.tar.xz hercules-71378dd896ac0ff839091a0c3ccca5abab20cda5.zip |
add an option to prevent from renaming a character if they are in a guild or party
closes #1805
Diffstat (limited to 'src/char')
-rw-r--r-- | src/char/char.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/char/char.c b/src/char/char.c index 54f6ca7d1..4ce4c55fe 100644 --- a/src/char/char.c +++ b/src/char/char.c @@ -139,6 +139,7 @@ char char_name_letters[1024] = ""; // list of letters/symbols allowed (or not) i static int char_del_level = 0; ///< From which level you can delete character [Lupus] static int char_del_delay = 86400; static bool char_aegis_delete = false; ///< Verify if char is in guild/party or char and reacts as Aegis does (disallow deletion), @see chr->delete2_req. +static bool char_aegis_rename = false; // whether or not the player can be renamed while in party/guild static int max_connect_user = -1; static int gm_allow_group = -1; @@ -1514,6 +1515,14 @@ static int char_rename_char_sql(struct char_session_data *sd, int char_id) if( char_dat.rename == 0 ) return 1; + if (char_aegis_rename) { + if (char_dat.guild_id > 0) { + return 5; // MSG_FAILED_RENAME_BELONGS_TO_GUILD + } else if (char_dat.party_id > 0) { + return 6; // MSG_FAILED_RENAME_BELONGS_TO_PARTY + } + } + SQL->EscapeStringLen(inter->sql_handle, esc_name, sd->new_name, strnlen(sd->new_name, NAME_LENGTH)); // check if the char exist @@ -5848,6 +5857,7 @@ static bool char_config_read_player_name(const char *filename, const struct conf libconfig->setting_lookup_mutable_string(setting, "name_letters", char_name_letters, sizeof(char_name_letters)); libconfig->setting_lookup_int(setting, "name_option", &char_name_option); libconfig->setting_lookup_bool_real(setting, "name_ignoring_case", &name_ignoring_case); + libconfig->setting_lookup_bool_real(setting, "use_aegis_rename", &char_aegis_rename); return true; } |