public static void teleportOut(
      PlayerHolder am,
      ArenaTeam team,
      ArenaPlayer player,
      TransitionOptions mo,
      int teamIndex,
      boolean insideArena,
      boolean onlyInMatch,
      boolean wipeInventory) {
    MatchParams mp = am.getParams();
    Location loc = null;
    ArenaLocation src = player.getCurLocation();
    final LocationType type;
    if (mo.hasOption(TransitionOption.TELEPORTTO)) {
      loc = mo.getTeleportToLoc();
      type = LocationType.CUSTOM;
    } else {
      type = LocationType.HOME;
      loc = player.getOldLocation();
      /// TODO
      /// This is a bit of a kludge, sometimes we are "teleporting them out"
      /// when they are already out... so need to rethink how this can happen and should it
      if (loc == null && src.getType() == LocationType.HOME) {
        loc = src.getLocation();
      }
    }
    player.clearOldLocation();
    if (loc == null) {
      Log.err(
          BattleArena.getNameAndVersion()
              + " Teleporting to a null location!  teleportTo="
              + mo.hasOption(TransitionOption.TELEPORTTO));
    }

    ArenaLocation dest = new ArenaLocation(AbstractAreaContainer.HOMECONTAINER, loc, type);
    ArenaPlayerTeleportEvent apte =
        new ArenaPlayerTeleportEvent(
            am.getParams().getType(), player, team, src, dest, TeleportDirection.OUT);
    movePlayer(player, apte, mp);
  }