Program: 164329
Project: 164329
Buggy source:
@Override public void create(){
  Music.INSTANCE.play(Assets.TUNE,true);
  Music.INSTANCE.volume(1f);
  ShatteredPixelDungeon.lastClass(Dungeon.hero.heroClass.ordinal());
  super.create();
  Camera.main.zoom(GameMath.gate(minZoom,defaultZoom + ShatteredPixelDungeon.zoom(),maxZoom));
  scene=this;
  terrain=new Group();
  add(terrain);
  water=new SkinnedBlock(Level.WIDTH * DungeonTilemap.SIZE,Level.HEIGHT * DungeonTilemap.SIZE,Dungeon.level.waterTex());
  terrain.add(water);
  ripples=new Group();
  terrain.add(ripples);
  tiles=new DungeonTilemap();
  terrain.add(tiles);
  Dungeon.level.addVisuals(this);
  plants=new Group();
  add(plants);
  int size=Dungeon.level.plants.size();
  for (int i=0; i < size; i++) {
    addPlantSprite(Dungeon.level.plants.valueAt(i));
  }
  heaps=new Group();
  add(heaps);
  size=Dungeon.level.heaps.size();
  for (int i=0; i < size; i++) {
    addHeapSprite(Dungeon.level.heaps.valueAt(i));
  }
  emitters=new Group();
  effects=new Group();
  emoicons=new Group();
  mobs=new Group();
  add(mobs);
  for (  Mob mob : Dungeon.level.mobs) {
    addMobSprite(mob);
    if (Statistics.amuletObtained) {
      mob.beckon(Dungeon.hero.pos);
    }
  }
  add(emitters);
  add(effects);
  gases=new Group();
  add(gases);
  for (  Blob blob : Dungeon.level.blobs.values()) {
    blob.emitter=null;
    addBlobSprite(blob);
  }
  fog=new FogOfWar(Level.WIDTH,Level.HEIGHT);
  fog.updateVisibility(Dungeon.visible,Dungeon.level.visited,Dungeon.level.mapped);
  add(fog);
  brightness(ShatteredPixelDungeon.brightness());
  spells=new Group();
  add(spells);
  statuses=new Group();
  add(statuses);
  add(emoicons);
  hero=new HeroSprite();
  hero.place(Dungeon.hero.pos);
  hero.updateArmor();
  mobs.add(hero);
  add(new HealthIndicator());
  add(cellSelector=new CellSelector(tiles));
  StatusPane sb=new StatusPane();
  sb.camera=uiCamera;
  sb.setSize(uiCamera.width,0);
  add(sb);
  toolbar=new Toolbar();
  toolbar.camera=uiCamera;
  toolbar.setRect(0,uiCamera.height - toolbar.height(),uiCamera.width,toolbar.height());
  add(toolbar);
  attack=new AttackIndicator();
  attack.camera=uiCamera;
  attack.setPos(uiCamera.width - attack.width(),toolbar.top() - attack.height());
  add(attack);
  loot=new LootIndicator();
  loot.camera=uiCamera;
  add(loot);
  resume=new ResumeIndicator();
  resume.camera=uiCamera;
  add(resume);
  layoutTags();
  log=new GameLog();
  log.camera=uiCamera;
  log.setRect(0,toolbar.top(),attack.left(),0);
  add(log);
  if (Dungeon.depth < Statistics.deepestFloor)   GLog.i(TXT_WELCOME_BACK,Dungeon.depth);
 else   GLog.i(TXT_WELCOME,Dungeon.depth);
  Sample.INSTANCE.play(Assets.SND_DESCEND);
switch (Dungeon.level.feeling) {
case CHASM:
    GLog.w(TXT_CHASM);
  break;
case WATER:
GLog.w(TXT_WATER);
break;
case GRASS:
GLog.w(TXT_GRASS);
break;
case DARK:
GLog.w(TXT_DARK);
break;
default :
}
if (Dungeon.level instanceof RegularLevel && ((RegularLevel)Dungeon.level).secretDoors > Random.IntRange(3,4)) {
GLog.w(TXT_SECRETS);
}
busy=new BusyIndicator();
busy.camera=uiCamera;
busy.x=1;
busy.y=sb.bottom() + 1;
add(busy);
switch (InterlevelScene.mode) {
case RESURRECT:
ScrollOfTeleportation.appear(Dungeon.hero,Dungeon.level.entrance);
new Flare(8,32).color(0xFFFF66,true).show(hero,2f);
break;
case RETURN:
ScrollOfTeleportation.appear(Dungeon.hero,Dungeon.hero.pos);
break;
case FALL:
Chasm.heroLand();
break;
case DESCEND:
switch (Dungeon.depth) {
case 1:
WndStory.showChapter(WndStory.ID_SEWERS);
break;
case 6:
WndStory.showChapter(WndStory.ID_PRISON);
break;
case 11:
WndStory.showChapter(WndStory.ID_CAVES);
break;
case 16:
WndStory.showChapter(WndStory.ID_METROPOLIS);
break;
case 22:
WndStory.showChapter(WndStory.ID_HALLS);
break;
}
if (Dungeon.hero.isAlive() && Dungeon.depth != 22) {
Badges.validateNoKilling();
}
break;
default :
}
ArrayList<Item> dropped=Dungeon.droppedItems.get(Dungeon.depth);
if (dropped != null) {
for (Item item : dropped) {
int pos=Dungeon.level.randomRespawnCell();
if (item instanceof Potion) {
((Potion)item).shatter(pos);
}
 else if (item instanceof Plant.Seed) {
Dungeon.level.plant((Plant.Seed)item,pos);
}
 else if (item instanceof Honeypot) {
Dungeon.level.drop(((Honeypot)item).shatter(null,pos),pos);
}
 else {
Dungeon.level.drop(item,pos);
}
}
Dungeon.droppedItems.remove(Dungeon.depth);
}
if (Dungeon.version <= 38 && Dungeon.hero.heroClass == HeroClass.MAGE) {
MagesStaff staff=new MagesStaff();
staff.identify();
GLog.p("String_Node_Str");
if (!staff.collect(Dungeon.hero.belongings.backpack)) {
Dungeon.level.drop(staff,Dungeon.hero.pos);
}
}
Camera.main.target=hero;
fadeIn();
}

Fixed version (ground truth):
@Override public void create(){
  Music.INSTANCE.play(Assets.TUNE,true);
  Music.INSTANCE.volume(1f);
  ShatteredPixelDungeon.lastClass(Dungeon.hero.heroClass.ordinal());
  super.create();
  Camera.main.zoom(GameMath.gate(minZoom,defaultZoom + ShatteredPixelDungeon.zoom(),maxZoom));
  scene=this;
  terrain=new Group();
  add(terrain);
  water=new SkinnedBlock(Level.WIDTH * DungeonTilemap.SIZE,Level.HEIGHT * DungeonTilemap.SIZE,Dungeon.level.waterTex());
  terrain.add(water);
  ripples=new Group();
  terrain.add(ripples);
  tiles=new DungeonTilemap();
  terrain.add(tiles);
  Dungeon.level.addVisuals(this);
  plants=new Group();
  add(plants);
  int size=Dungeon.level.plants.size();
  for (int i=0; i < size; i++) {
    addPlantSprite(Dungeon.level.plants.valueAt(i));
  }
  heaps=new Group();
  add(heaps);
  size=Dungeon.level.heaps.size();
  for (int i=0; i < size; i++) {
    addHeapSprite(Dungeon.level.heaps.valueAt(i));
  }
  emitters=new Group();
  effects=new Group();
  emoicons=new Group();
  mobs=new Group();
  add(mobs);
  for (  Mob mob : Dungeon.level.mobs) {
    addMobSprite(mob);
    if (Statistics.amuletObtained) {
      mob.beckon(Dungeon.hero.pos);
    }
  }
  add(emitters);
  add(effects);
  gases=new Group();
  add(gases);
  for (  Blob blob : Dungeon.level.blobs.values()) {
    blob.emitter=null;
    addBlobSprite(blob);
  }
  fog=new FogOfWar(Level.WIDTH,Level.HEIGHT);
  fog.updateVisibility(Dungeon.visible,Dungeon.level.visited,Dungeon.level.mapped);
  add(fog);
  brightness(ShatteredPixelDungeon.brightness());
  spells=new Group();
  add(spells);
  statuses=new Group();
  add(statuses);
  add(emoicons);
  hero=new HeroSprite();
  hero.place(Dungeon.hero.pos);
  hero.updateArmor();
  mobs.add(hero);
  add(new HealthIndicator());
  add(cellSelector=new CellSelector(tiles));
  StatusPane sb=new StatusPane();
  sb.camera=uiCamera;
  sb.setSize(uiCamera.width,0);
  add(sb);
  toolbar=new Toolbar();
  toolbar.camera=uiCamera;
  toolbar.setRect(0,uiCamera.height - toolbar.height(),uiCamera.width,toolbar.height());
  add(toolbar);
  attack=new AttackIndicator();
  attack.camera=uiCamera;
  attack.setPos(uiCamera.width - attack.width(),toolbar.top() - attack.height());
  add(attack);
  loot=new LootIndicator();
  loot.camera=uiCamera;
  add(loot);
  resume=new ResumeIndicator();
  resume.camera=uiCamera;
  add(resume);
  layoutTags();
  log=new GameLog();
  log.camera=uiCamera;
  log.setRect(0,toolbar.top(),attack.left(),0);
  add(log);
  if (Dungeon.depth < Statistics.deepestFloor)   GLog.i(TXT_WELCOME_BACK,Dungeon.depth);
 else   GLog.i(TXT_WELCOME,Dungeon.depth);
  Sample.INSTANCE.play(Assets.SND_DESCEND);
switch (Dungeon.level.feeling) {
case CHASM:
    GLog.w(TXT_CHASM);
  break;
case WATER:
GLog.w(TXT_WATER);
break;
case GRASS:
GLog.w(TXT_GRASS);
break;
case DARK:
GLog.w(TXT_DARK);
break;
default :
}
if (Dungeon.level instanceof RegularLevel && ((RegularLevel)Dungeon.level).secretDoors > Random.IntRange(3,4)) {
GLog.w(TXT_SECRETS);
}
busy=new BusyIndicator();
busy.camera=uiCamera;
busy.x=1;
busy.y=sb.bottom() + 1;
add(busy);
switch (InterlevelScene.mode) {
case RESURRECT:
ScrollOfTeleportation.appear(Dungeon.hero,Dungeon.level.entrance);
new Flare(8,32).color(0xFFFF66,true).show(hero,2f);
break;
case RETURN:
ScrollOfTeleportation.appear(Dungeon.hero,Dungeon.hero.pos);
break;
case FALL:
Chasm.heroLand();
break;
case DESCEND:
switch (Dungeon.depth) {
case 1:
WndStory.showChapter(WndStory.ID_SEWERS);
break;
case 6:
WndStory.showChapter(WndStory.ID_PRISON);
break;
case 11:
WndStory.showChapter(WndStory.ID_CAVES);
break;
case 16:
WndStory.showChapter(WndStory.ID_METROPOLIS);
break;
case 22:
WndStory.showChapter(WndStory.ID_HALLS);
break;
}
if (Dungeon.hero.isAlive() && Dungeon.depth != 22) {
Badges.validateNoKilling();
}
break;
default :
}
ArrayList<Item> dropped=Dungeon.droppedItems.get(Dungeon.depth);
if (dropped != null) {
for (Item item : dropped) {
int pos=Dungeon.level.randomRespawnCell();
if (item instanceof Potion) {
((Potion)item).shatter(pos);
}
 else if (item instanceof Plant.Seed) {
Dungeon.level.plant((Plant.Seed)item,pos);
}
 else if (item instanceof Honeypot) {
Dungeon.level.drop(((Honeypot)item).shatter(null,pos),pos);
}
 else {
Dungeon.level.drop(item,pos);
}
}
Dungeon.droppedItems.remove(Dungeon.depth);
}
Camera.main.target=hero;
fadeIn();
}