mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2025-12-09 16:45:44 -07:00
Fixed random events returning players to Lumbridge
This commit is contained in:
parent
fc2247f457
commit
1b0a7d5fca
1 changed files with 5 additions and 0 deletions
|
|
@ -15,6 +15,11 @@ fun kidnapPlayer(player: Player, loc: Location, type: TeleportType) {
|
||||||
}
|
}
|
||||||
|
|
||||||
fun returnPlayer(player: Player) {
|
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()
|
player.locks.unlockTeleport()
|
||||||
val destination = getAttribute(player, "/save:original-loc", ServerConstants.HOME_LOCATION ?: Location.create(3222, 3218, 0))
|
val destination = getAttribute(player, "/save:original-loc", ServerConstants.HOME_LOCATION ?: Location.create(3222, 3218, 0))
|
||||||
teleport(player, destination)
|
teleport(player, destination)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue