From e6f1faea0e4d820dfad3b25a689821057eb0a650 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Sat, 22 Feb 2020 18:23:13 +0100 Subject: [PATCH] Revert "Correctly detect player level on difficulty selection screen (#626)" This reverts commit e6b6501079b5b16209db846ea66e7c32d02389d0. --- SourceX/DiabloUI/diabloui.cpp | 2 +- SourceX/DiabloUI/diabloui.h | 2 +- SourceX/DiabloUI/selgame.cpp | 2 +- SourceX/DiabloUI/selhero.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/SourceX/DiabloUI/diabloui.cpp b/SourceX/DiabloUI/diabloui.cpp index 43ac52976..5ebbc2b40 100644 --- a/SourceX/DiabloUI/diabloui.cpp +++ b/SourceX/DiabloUI/diabloui.cpp @@ -36,7 +36,7 @@ Art ArtBackground; Art ArtCursor; Art ArtHero; bool gbSpawned; -_uiheroinfo *heroInfo; +int heroLevel; void (*gfnSoundFunction)(char *file); void (*gfnListFocus)(int value); diff --git a/SourceX/DiabloUI/diabloui.h b/SourceX/DiabloUI/diabloui.h index 893df8b45..0d1529d99 100644 --- a/SourceX/DiabloUI/diabloui.h +++ b/SourceX/DiabloUI/diabloui.h @@ -28,7 +28,7 @@ extern Art ArtBackground; extern Art ArtCursor; extern Art ArtHero; extern bool gbSpawned; -extern _uiheroinfo *heroInfo; +extern int heroLevel; constexpr auto MAINMENU_BACKGROUND = UiImage(&ArtBackground, { 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT }); constexpr auto MAINMENU_LOGO = UiImage(&ArtLogos[LOGO_MED], /*animated=*/true, /*frame=*/0, { 0, 0, 0, 0 }, UIS_CENTER); diff --git a/SourceX/DiabloUI/selgame.cpp b/SourceX/DiabloUI/selgame.cpp index 7d5fc3a3e..84e48254e 100644 --- a/SourceX/DiabloUI/selgame.cpp +++ b/SourceX/DiabloUI/selgame.cpp @@ -171,7 +171,7 @@ void selgame_Diff_Focus(int value) bool IsDifficultyAllowed(int value) { - if (value == 0 || (value == 1 && heroInfo->level >= 20) || (value == 2 && heroInfo->level >= 30)) { + if (value == 0 || (value == 1 && heroLevel >= 20) || (value == 2 && heroLevel >= 30)) { return true; } diff --git a/SourceX/DiabloUI/selhero.cpp b/SourceX/DiabloUI/selhero.cpp index 43f964fd4..35247854b 100644 --- a/SourceX/DiabloUI/selhero.cpp +++ b/SourceX/DiabloUI/selhero.cpp @@ -386,7 +386,7 @@ BOOL UiSelHeroDialog( *dlgresult = selhero_result; strcpy(name, selhero_heroInfo.name); - heroInfo = &selhero_heroInfo; + heroLevel = selhero_heroInfo.level; UnloadScrollBar(); return true;