Browse Source

fix name check and limit to multi (#2486)

pull/2487/head
qndel 5 years ago committed by GitHub
parent
commit
81fadc79ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 15
      Source/DiabloUI/selhero.cpp

15
Source/DiabloUI/selhero.cpp

@ -299,18 +299,19 @@ void SelheroClassSelectorEsc()
void SelheroNameSelect(int /*value*/)
{
if (!UiValidPlayerName(selhero_heroInfo.name)) {
// only check names in multiplayer, we don't care about them in single
if (selhero_isMultiPlayer && !UiValidPlayerName(selhero_heroInfo.name)) {
ArtBackground.Unload();
UiSelOkDialog(title, _("Invalid name. A name cannot contain spaces, reserved characters, or reserved words.\n"), false);
LoadBackgroundArt("ui_art\\selhero.pcx");
} else{
if (gfnHeroCreate(&selhero_heroInfo)) {
SelheroLoadSelect(1);
return;
}
UiErrorOkDialog(_(/* TRANSLATORS: Error Message */ "Unable to create character."), vecSelDlgItems);
}
if (gfnHeroCreate(&selhero_heroInfo)) {
SelheroLoadSelect(1);
return;
}
UiErrorOkDialog(_(/* TRANSLATORS: Error Message */ "Unable to create character."), vecSelDlgItems);
memset(selhero_heroInfo.name, '\0', sizeof(selhero_heroInfo.name));
SelheroClassSelectorSelect(0);
}

Loading…
Cancel
Save