Browse Source

Correctly detect player level on difficulty selection screen (#626)

pull/634/head
SeanHenderson 6 years ago committed by GitHub
parent
commit
e6b6501079
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      SourceX/DiabloUI/diabloui.cpp
  2. 2
      SourceX/DiabloUI/diabloui.h
  3. 2
      SourceX/DiabloUI/selgame.cpp
  4. 2
      SourceX/DiabloUI/selhero.cpp

2
SourceX/DiabloUI/diabloui.cpp

@ -36,7 +36,7 @@ Art ArtBackground;
Art ArtCursor;
Art ArtHero;
bool gbSpawned;
int heroLevel;
_uiheroinfo *heroInfo;
void (*gfnSoundFunction)(char *file);
void (*gfnListFocus)(int value);

2
SourceX/DiabloUI/diabloui.h

@ -28,7 +28,7 @@ extern Art ArtBackground;
extern Art ArtCursor;
extern Art ArtHero;
extern bool gbSpawned;
extern int heroLevel;
extern _uiheroinfo *heroInfo;
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);

2
SourceX/DiabloUI/selgame.cpp

@ -171,7 +171,7 @@ void selgame_Diff_Focus(int value)
bool IsDifficultyAllowed(int value)
{
if (value == 0 || (value == 1 && heroLevel >= 20) || (value == 2 && heroLevel >= 30)) {
if (value == 0 || (value == 1 && heroInfo->level >= 20) || (value == 2 && heroInfo->level >= 30)) {
return true;
}

2
SourceX/DiabloUI/selhero.cpp

@ -386,7 +386,7 @@ BOOL UiSelHeroDialog(
*dlgresult = selhero_result;
strcpy(name, selhero_heroInfo.name);
heroLevel = selhero_heroInfo.level;
heroInfo = &selhero_heroInfo;
UnloadScrollBar();
return true;

Loading…
Cancel
Save