use of com.watabou.pixeldungeon.actors.buffs.Light in project pixel-dungeon by watabou.
the class Dungeon method switchLevel.
@SuppressWarnings("deprecation")
public static void switchLevel(final Level level, int pos) {
nightMode = new Date().getHours() < 7;
Dungeon.level = level;
Actor.init();
Actor respawner = level.respawner();
if (respawner != null) {
Actor.add(level.respawner());
}
hero.pos = pos != -1 ? pos : level.exit;
Light light = hero.buff(Light.class);
hero.viewDistance = light == null ? level.viewDistance : Math.max(Light.DISTANCE, level.viewDistance);
observe();
}