summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--conf/char_athena.conf2
-rw-r--r--src/char/char.c14
2 files changed, 11 insertions, 5 deletions
diff --git a/conf/char_athena.conf b/conf/char_athena.conf
index 7c0efa3a1..bd2e2793c 100644
--- a/conf/char_athena.conf
+++ b/conf/char_athena.conf
@@ -139,6 +139,8 @@ char_name_option: 1
char_name_letters: abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890
// How many Characters are allowed per Account ? (0 = disabled)
+// You can not exceed the limit of MAX_CHARS slots, defined in mmo.h
+// Doing that, chars_per_account will be default to MAX_CHARS.
chars_per_account: 0
// Restrict character deletion by BaseLevel
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) {