diff --git a/system/pages/accountmanagement.php b/system/pages/accountmanagement.php index 7767d007..f5ac7998 100644 --- a/system/pages/accountmanagement.php +++ b/system/pages/accountmanagement.php @@ -796,6 +796,8 @@ function checkName() $newchar_vocation = isset($_POST['newcharvocation']) ? $_POST['newcharvocation'] : NULL; $newchar_town = isset($_POST['newchartown']) ? $_POST['newchartown'] : NULL; $newchar_errors = array(); + + $newchar_created = false; if(isset($_POST['savecharacter']) && $_POST['savecharacter'] == 1) { if(empty($newchar_name)) $newchar_errors[] = 'Please enter a name for your character!'; @@ -897,7 +899,7 @@ function checkName() } if(fieldExist('lookaddons', 'players')) - $player->setLookAddons($char_to_copy->getLookAddons()); + $player->setLookAddons($char_to_copy->getLookAddons()); $player->setTownId($newchar_town); $player->setExperience($char_to_copy->getExperience()); @@ -929,6 +931,8 @@ function checkName() } $player->save(); $player->setCustomField("created", time()); + + $newchar_created = true; $account_logged->logAction('Created character ' . $player->getName() . '.'); unset($player); $player = $ots->createObject('Player'); @@ -958,15 +962,16 @@ function checkName() } } } - else - { - if(count($newchar_errors) > 0) { - echo '
'; - echo 'The Following Errors Have Occurred:
'; - foreach($newchar_errors as $newchar_error) - echo '
  • '.$newchar_error . '
  • '; - echo '

    '; - } + + if(count($newchar_errors) > 0) { + echo '
    '; + echo 'The Following Errors Have Occurred:
    '; + foreach($newchar_errors as $newchar_error) + echo '
  • '.$newchar_error . '
  • '; + echo '

    '; + } + + if(!$newchar_created) { echo 'Please choose a name'; if(count($config['character_samples']) > 1) echo ', vocation';