v0.4.1a: improved exception handling for rooms

This commit is contained in:
Evan Debenham 2016-08-10 11:04:27 -04:00
parent e5439e6bcd
commit 4019e7333c

View File

@ -105,13 +105,16 @@ public class Room extends Rect implements Graph.Node, Bundlable {
private Method paint; private Method paint;
private Type( Class<? extends Painter> painter ) { Type( Class<? extends Painter> painter ) {
try { if (painter == null)
paint = painter.getMethod( "paint", Level.class, Room.class );
} catch (Exception e) {
ShatteredPixelDungeon.reportException(e);
paint = null; paint = null;
} else
try {
paint = painter.getMethod( "paint", Level.class, Room.class );
} catch (Exception e) {
ShatteredPixelDungeon.reportException(e);
paint = null;
}
} }
public void paint( Level level, Room room ) { public void paint( Level level, Room room ) {