Program: 8860
Project: 8860
Buggy source:
/** 
 * Damage a tile
 * @param point the point
 * @param playerId the player applying the damage
 * @return you might get gold out of this
 */
public int damageTile(Point point,short playerId){
  TileData tile=getMapData().getTile(point);
  Terrain terrain=tile.getTerrain();
  int damage=0;
  int returnedGold=0;
  if (terrain.getFlags().contains(Terrain.TerrainFlag.SOLID)) {
    if (terrain.getFlags().contains(Terrain.TerrainFlag.OWNABLE)) {
      if (tile.getPlayerId() == playerId) {
        damage=(int)getLevelVariable(Variable.MiscVariable.MiscType.DIG_OWN_WALL_HEALTH);
      }
 else {
        damage=(int)getLevelVariable(Variable.MiscVariable.MiscType.DIG_ENEMY_WALL_HEALTH);
      }
    }
 else     if (tile.getGold() > 0) {
      if (terrain.getFlags().contains(Terrain.TerrainFlag.IMPENETRABLE)) {
        damage=(int)getLevelVariable(Variable.MiscVariable.MiscType.GOLD_MINED_FROM_GEMS);
      }
 else {
        damage=(int)getLevelVariable(Variable.MiscVariable.MiscType.MINE_GOLD_HEALTH);
      }
    }
 else {
      damage=(int)getLevelVariable(Variable.MiscVariable.MiscType.DIG_ROCK_HEALTH);
    }
  }
 else   if (terrain.getFlags().contains(Terrain.TerrainFlag.OWNABLE) && tile.getPlayerId() != playerId) {
    damage=(int)getLevelVariable(Variable.MiscVariable.MiscType.ATTACK_TILE_HEALTH);
  }
 else {
    throw new UnsupportedOperationException("String_Node_Str" + terrain.getName() + "String_Node_Str"+ point+ "String_Node_Str");
  }
  boolean tileDestroyed;
  damage=Math.abs(damage);
  if (tile.getGold() > 0) {
    if (terrain.getFlags().contains(Terrain.TerrainFlag.IMPENETRABLE)) {
      returnedGold=damage;
      tileDestroyed=false;
    }
 else {
      returnedGold=tile.mineGold(damage);
      tileDestroyed=(tile.getGold() < 1);
    }
  }
 else {
    tileDestroyed=tile.applyDamage(damage);
  }
  if (tileDestroyed) {
    if (terrain.getDestroyedEffectId() != 0) {
      effectManager.load(worldNode,WorldUtils.pointToVector3f(point),terrain.getDestroyedEffectId(),false);
    }
    tile.setTerrainId(terrain.getDestroyedTypeTerrainId());
    updateRoomWalls(tile);
    mapLoader.updateTiles(mapLoader.getSurroundingTiles(tile.getLocation(),true));
    notifyTileChange(point);
  }
 else   if (terrain.getFlags().contains(Terrain.TerrainFlag.DECAY)) {
    mapLoader.updateTiles(point);
  }
  return returnedGold;
}

Fixed version (ground truth):
/** 
 * Damage a tile
 * @param point the point
 * @param playerId the player applying the damage
 * @return you might get gold out of this
 */
public int damageTile(Point point,short playerId){
  TileData tile=getMapData().getTile(point);
  Terrain terrain=tile.getTerrain();
  int damage=0;
  int returnedGold=0;
  if (terrain.getFlags().contains(Terrain.TerrainFlag.SOLID)) {
    if (terrain.getFlags().contains(Terrain.TerrainFlag.OWNABLE)) {
      if (tile.getPlayerId() == playerId) {
        damage=(int)getLevelVariable(Variable.MiscVariable.MiscType.DIG_OWN_WALL_HEALTH);
      }
 else {
        damage=(int)getLevelVariable(Variable.MiscVariable.MiscType.DIG_ENEMY_WALL_HEALTH);
      }
    }
 else     if (tile.getGold() > 0) {
      if (terrain.getFlags().contains(Terrain.TerrainFlag.IMPENETRABLE)) {
        damage=(int)getLevelVariable(Variable.MiscVariable.MiscType.GOLD_MINED_FROM_GEMS);
      }
 else {
        damage=(int)getLevelVariable(Variable.MiscVariable.MiscType.MINE_GOLD_HEALTH);
      }
    }
 else {
      damage=(int)getLevelVariable(Variable.MiscVariable.MiscType.DIG_ROCK_HEALTH);
    }
  }
 else   if (terrain.getFlags().contains(Terrain.TerrainFlag.OWNABLE) && tile.getPlayerId() != playerId) {
    damage=(int)getLevelVariable(Variable.MiscVariable.MiscType.ATTACK_TILE_HEALTH);
  }
 else {
    throw new UnsupportedOperationException("String_Node_Str" + terrain.getName() + "String_Node_Str"+ point+ "String_Node_Str");
  }
  boolean tileDestroyed;
  damage=Math.abs(damage);
  if (tile.getGold() > 0) {
    if (terrain.getFlags().contains(Terrain.TerrainFlag.IMPENETRABLE)) {
      returnedGold=damage;
      tileDestroyed=false;
    }
 else {
      returnedGold=tile.mineGold(damage);
      tileDestroyed=(tile.getGold() < 1);
    }
  }
 else {
    tileDestroyed=tile.applyDamage(damage);
  }
  if (tileDestroyed) {
    if (terrain.getDestroyedEffectId() != 0) {
      effectManager.load(worldNode,WorldUtils.pointToVector3f(point).addLocal(0,MapLoader.FLOOR_HEIGHT,0),terrain.getDestroyedEffectId(),false);
    }
    tile.setTerrainId(terrain.getDestroyedTypeTerrainId());
    updateRoomWalls(tile);
    mapLoader.updateTiles(mapLoader.getSurroundingTiles(tile.getLocation(),true));
    notifyTileChange(point);
  }
 else   if (terrain.getFlags().contains(Terrain.TerrainFlag.DECAY)) {
    mapLoader.updateTiles(point);
  }
  return returnedGold;
}