v0.4.1a: improved exception handling for rooms
This commit is contained in:
parent
e5439e6bcd
commit
4019e7333c
|
@ -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 ) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user