Fixed an exploit in surprise exam

This commit is contained in:
ceikry
2023-06-05 05:57:28 -05:00
committed by Ryan
parent c1b2fdf597
commit 3d20bb97d0
@@ -9,6 +9,7 @@ import core.game.system.task.Pulse
import core.game.world.map.Location
import org.rs09.consts.Components
import org.rs09.consts.Items
import core.ServerConstants
object SurpriseExamUtils {
@@ -32,7 +33,7 @@ object SurpriseExamUtils {
player.setAttribute(SE_KEY_LOC,player.location)
registerLogoutListener(player, SE_LOGOUT_KEY){p ->
teleport(p, p.getAttribute(SE_KEY_LOC, p.location))
p.location = getAttribute(p, SE_KEY_LOC, ServerConstants.HOME_LOCATION)
}
player.properties.teleportLocation = Location.create(1886, 5025, 0)
@@ -81,4 +82,4 @@ object SurpriseExamUtils {
fun pickRandomDoor(player: Player){
player.setAttribute(SE_DOOR_KEY, SE_DOORS.random())
}
}
}