Fixed random events returning players to Lumbridge

This commit is contained in:
Alex Page 2025-03-25 09:51:47 +00:00 committed by Ryan
parent fc2247f457
commit 1b0a7d5fca

View file

@ -15,6 +15,11 @@ fun kidnapPlayer(player: Player, loc: Location, type: TeleportType) {
}
fun returnPlayer(player: Player) {
// Prevent returning more than once and sending the player back to HOME_LOCATION
if (getAttribute<Location?>(player, "kidnapped-by-random", null) == null) {
return
}
player.locks.unlockTeleport()
val destination = getAttribute(player, "/save:original-loc", ServerConstants.HOME_LOCATION ?: Location.create(3222, 3218, 0))
teleport(player, destination)