diff options
author | momacabu <momacabu@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-11-20 15:58:29 +0000 |
---|---|---|
committer | momacabu <momacabu@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-11-20 15:58:29 +0000 |
commit | 6cea35b21b3327b8ed5981daf5549dda7ecc48cf (patch) | |
tree | 52163008cca4b6394c6faca626d7a7d3274a577a /src | |
parent | a10e65fdc82e4073909354e760c95080a407d25e (diff) | |
download | hercules-6cea35b21b3327b8ed5981daf5549dda7ecc48cf.tar.gz hercules-6cea35b21b3327b8ed5981daf5549dda7ecc48cf.tar.bz2 hercules-6cea35b21b3327b8ed5981daf5549dda7ecc48cf.tar.xz hercules-6cea35b21b3327b8ed5981daf5549dda7ecc48cf.zip |
Minor improvement in char_per_account setting, which could be greater than MAX_CHARS.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16937 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r-- | src/char/char.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/char/char.c b/src/char/char.c index 6d23dea16..3c96077fd 100644 --- a/src/char/char.c +++ b/src/char/char.c @@ -105,7 +105,7 @@ char unknown_char_name[NAME_LENGTH] = "Unknown"; // Name to use when the request #define TRIM_CHARS "\255\xA0\032\t\x0A\x0D " //The following characters are trimmed regardless because they cause confusion and problems on the servers. [Skotlex] char char_name_letters[1024] = ""; // list of letters/symbols allowed (or not) in a character name. by [Yor] -int char_per_account = 0; //Maximum charas per account (default unlimited) [Sirius] +int char_per_account = 0; //Maximum chars per account (default unlimited) [Sirius] int char_del_level = 0; //From which level u can delete character [Lupus] int char_del_delay = 86400; @@ -1338,10 +1338,10 @@ int mmo_char_sql_init(void) { char_db_= idb_alloc(DB_OPT_RELEASE_DATA); - if(char_per_account == 0){ - ShowStatus("Chars per Account: 'Unlimited'.......\n"); - }else{ - ShowStatus("Chars per Account: '%d'.......\n", char_per_account); + if (char_per_account == 0) { + ShowStatus("Characters per Account: 'Unlimited'.\n"); + } else { + ShowStatus("Characters per Account: '%d'.\n", char_per_account); } //the 'set offline' part is now in check_login_conn ... @@ -4592,6 +4592,10 @@ int char_config_read(const char* cfgName) safestrncpy(char_name_letters, w2, sizeof(char_name_letters)); } else if (strcmpi(w1, "chars_per_account") == 0) { //maxchars per account [Sirius] char_per_account = atoi(w2); + if( char_per_account > MAX_CHARS ) { + ShowWarning("Max chars per account '%d' exceeded limit. Defaulting to '%d'.\n", char_per_account, MAX_CHARS); + char_per_account = MAX_CHARS; + } } else if (strcmpi(w1, "char_del_level") == 0) { //disable/enable char deletion by its level condition [Lupus] char_del_level = atoi(w2); } else if (strcmpi(w1, "char_del_delay") == 0) { |