v2.4.0: added a safety check to hero info button

This commit is contained in:
Evan Debenham
2024-03-14 13:01:33 -04:00
parent fd53f18089
commit f89b687ed8

View File

@@ -153,11 +153,14 @@ public class HeroSelectScene extends PixelScene {
@Override
protected void onClick() {
super.onClick();
Window w = new WndHeroInfo(GamesInProgress.selectedClass);
if (landscape()){
w.offset(Camera.main.width/6, 0);
HeroClass cls = GamesInProgress.selectedClass;
if (cls != null) {
Window w = new WndHeroInfo(GamesInProgress.selectedClass);
if (landscape()) {
w.offset(Camera.main.width / 6, 0);
}
ShatteredPixelDungeon.scene().addToFront(w);
}
ShatteredPixelDungeon.scene().addToFront(w);
}
@Override