Fix account character create if auto_login is enabled

This commit is contained in:
slawkens 2021-07-27 18:42:52 +02:00
parent a11d038c1d
commit 84c39676ee

View File

@ -223,6 +223,14 @@ if($save)
} }
else else
{ {
if(config('account_create_character_create')) {
// character creation
$character_created = $createCharacter->doCreate($character_name, $character_sex, $character_vocation, $character_town, $new_account, $errors);
if (!$character_created) {
error('There was an error creating your character. Please create your character later in account management page.');
}
}
if($config['account_create_auto_login']) { if($config['account_create_auto_login']) {
$_POST['account_login'] = USE_ACCOUNT_NAME ? $account_name : $account_id; $_POST['account_login'] = USE_ACCOUNT_NAME ? $account_name : $account_id;
$_POST['password_login'] = $password2; $_POST['password_login'] = $password2;
@ -265,14 +273,6 @@ if($save)
error('An error occurred while sending email. For Admin: More info can be found in system/logs/mailer-error.log'); error('An error occurred while sending email. For Admin: More info can be found in system/logs/mailer-error.log');
} }
} }
if(config('account_create_character_create')) {
// character creation
$character_created = $createCharacter->doCreate($character_name, $character_sex, $character_vocation, $character_town, $new_account, $errors);
if (!$character_created) {
error('There was an error creating your character. Please create your character later in account management page.');
}
}
} }
return; return;