diff --git a/src/main/java/fr/xephi/authme/process/login/AsynchronousLogin.java b/src/main/java/fr/xephi/authme/process/login/AsynchronousLogin.java index 9a32a92f..4ef46fc8 100644 --- a/src/main/java/fr/xephi/authme/process/login/AsynchronousLogin.java +++ b/src/main/java/fr/xephi/authme/process/login/AsynchronousLogin.java @@ -274,6 +274,7 @@ public class AsynchronousLogin implements AsynchronousProcess { auth.setRealName(player.getName()); auth.setLastLogin(System.currentTimeMillis()); auth.setLastIp(ip); + auth.setQuitLocation(player.getLocation()); dataSource.updateSession(auth); // TODO: send an update when a messaging service will be implemented (SESSION) diff --git a/src/main/java/fr/xephi/authme/service/TeleportationService.java b/src/main/java/fr/xephi/authme/service/TeleportationService.java index c5f27052..c23cae4a 100644 --- a/src/main/java/fr/xephi/authme/service/TeleportationService.java +++ b/src/main/java/fr/xephi/authme/service/TeleportationService.java @@ -142,8 +142,9 @@ public class TeleportationService implements Reloadable { logger.debug("Teleporting `{0}` to spawn because of 'force-spawn after login'", player.getName()); teleportToSpawn(player, true); } else if (settings.getProperty(TELEPORT_UNAUTHED_TO_SPAWN)) { - if (settings.getProperty(RestrictionSettings.SAVE_QUIT_LOCATION) && auth.getQuitLocY() != 0) { + if (settings.getProperty(RestrictionSettings.SAVE_QUIT_LOCATION)) { Location location = buildLocationFromAuth(player, auth); + if (location.equals(player.getLocation())) return; logger.debug("Teleporting `{0}` after login, based on the player auth", player.getName()); teleportBackFromSpawn(player, location); } else if (limbo != null && limbo.getLocation() != null) {