Program: 164202
Project: 164202
Buggy source:
@Override public void onSelect(Integer target){
  if (target == null)   return;
  Invisibility.dispel();
  charge-=Dungeon.depth > 20 ? 2 : 1;
  updateQuickslot();
  if (Actor.findChar(target) == curUser) {
    ScrollOfTeleportation.teleportHero(curUser);
    curUser.spendAndNext(1f);
  }
 else {
    final Ballistica bolt=new Ballistica(curUser.pos,target,Ballistica.MAGIC_BOLT);
    final Char ch=Actor.findChar(bolt.collisionPos);
    if (ch == curUser) {
      ScrollOfTeleportation.teleportHero(curUser);
      curUser.spendAndNext(1f);
    }
 else {
      Sample.INSTANCE.play(Assets.SND_ZAP);
      curUser.sprite.zap(bolt.collisionPos);
      curUser.busy();
      MagicMissile.force(curUser.sprite.parent,bolt.sourcePos,bolt.collisionPos,new Callback(){
        @Override public void call(){
          if (ch != null) {
            int count=10;
            int pos;
            do {
              pos=Dungeon.level.randomRespawnCell();
              if (count-- <= 0) {
                break;
              }
            }
 while (pos == -1);
            if (pos == -1 || Dungeon.bossLevel()) {
              GLog.w(Messages.get(ScrollOfTeleportation.class,"String_Node_Str"));
            }
 else             if (ch.properties().contains(Char.Property.IMMOVABLE)) {
              GLog.w(Messages.get(this,"String_Node_Str"));
            }
 else {
              ch.pos=pos;
              ch.sprite.place(ch.pos);
              ch.sprite.visible=Dungeon.visible[pos];
            }
          }
          curUser.spendAndNext(1f);
        }
      }
);
    }
  }
}

Fixed version (ground truth):
@Override public void onSelect(Integer target){
  if (target == null)   return;
  Invisibility.dispel();
  charge-=Dungeon.depth > 20 ? 2 : 1;
  updateQuickslot();
  if (Actor.findChar(target) == curUser) {
    ScrollOfTeleportation.teleportHero(curUser);
    curUser.spendAndNext(1f);
  }
 else {
    final Ballistica bolt=new Ballistica(curUser.pos,target,Ballistica.MAGIC_BOLT);
    final Char ch=Actor.findChar(bolt.collisionPos);
    if (ch == curUser) {
      ScrollOfTeleportation.teleportHero(curUser);
      curUser.spendAndNext(1f);
    }
 else {
      Sample.INSTANCE.play(Assets.SND_ZAP);
      curUser.sprite.zap(bolt.collisionPos);
      curUser.busy();
      MagicMissile.force(curUser.sprite.parent,bolt.sourcePos,bolt.collisionPos,new Callback(){
        @Override public void call(){
          if (ch != null) {
            int count=10;
            int pos;
            do {
              pos=Dungeon.level.randomRespawnCell();
              if (count-- <= 0) {
                break;
              }
            }
 while (pos == -1);
            if (pos == -1 || Dungeon.bossLevel()) {
              GLog.w(Messages.get(ScrollOfTeleportation.class,"String_Node_Str"));
            }
 else             if (ch.properties().contains(Char.Property.IMMOVABLE)) {
              GLog.w(Messages.get(LloydsBeacon.class,"String_Node_Str"));
            }
 else {
              ch.pos=pos;
              ch.sprite.place(ch.pos);
              ch.sprite.visible=Dungeon.visible[pos];
            }
          }
          curUser.spendAndNext(1f);
        }
      }
);
    }
  }
}