v0.6.1: fixed various crashes caused by initalizing items in the changes scene

This commit is contained in:
Evan Debenham 2017-07-29 03:12:00 -04:00 committed by Evan Debenham
parent ceb6ca2668
commit a41309ed66
5 changed files with 14 additions and 8 deletions

View File

@ -338,7 +338,7 @@ public class Item implements Bundlable {
levelKnown = true; levelKnown = true;
cursedKnown = true; cursedKnown = true;
if (Dungeon.hero.isAlive()) { if (Dungeon.hero != null && Dungeon.hero.isAlive()) {
Catalog.setSeen(getClass()); Catalog.setSeen(getClass());
} }

View File

@ -126,8 +126,10 @@ public class Potion extends Item {
@Override @Override
public void reset(){ public void reset(){
super.reset(); super.reset();
image = handler.image( this ); if (handler != null) {
color = handler.label( this ); image = handler.image(this);
color = handler.label(this);
}
}; };
@Override @Override

View File

@ -109,8 +109,10 @@ public class Ring extends KindofMisc {
public void reset() { public void reset() {
super.reset(); super.reset();
image = handler.image( this ); if (handler != null){
gem = handler.label( this ); image = handler.image(this);
gem = handler.label(this);
}
} }
public void activate( Char ch ) { public void activate( Char ch ) {

View File

@ -115,8 +115,10 @@ public abstract class Scroll extends Item {
@Override @Override
public void reset(){ public void reset(){
super.reset(); super.reset();
image = handler.image( this ); if (handler != null) {
rune = handler.label( this ); image = handler.image(this);
rune = handler.label(this);
}
}; };
@Override @Override

View File

@ -31,7 +31,7 @@ import com.watabou.noosa.ui.Component;
public class WndTitledMessage extends Window { public class WndTitledMessage extends Window {
protected static final int WIDTH_P = 120; protected static final int WIDTH_P = 120;
protected static final int WIDTH_L = 144; protected static final int WIDTH_L = 160;
protected static final int GAP = 2; protected static final int GAP = 2;
public WndTitledMessage( Image icon, String title, String message ) { public WndTitledMessage( Image icon, String title, String message ) {