Fixes to character name validation

Admin should be able to create any name
Also fixes to config.character_name_min_length being ignored
This commit is contained in:
slawkens
2021-01-20 18:02:07 +01:00
parent 8b41e144f8
commit 81b293a5a6
4 changed files with 32 additions and 14 deletions

View File

@@ -35,6 +35,13 @@ class CreateCharacter
}
}
$player = new OTS_Player();
$player->find($name);
if($player->isLoaded()) {
$errors['name'] = 'Character with this name already exist.';
return false;
}
if(empty($sex) && $sex != "0")
$errors['sex'] = 'Please select the sex for your character!';
@@ -214,4 +221,4 @@ class CreateCharacter
$account->logAction('Created character <b>' . $name . '</b>.');
return true;
}
}
}