Check world before performing distance call (#916)

This commit is contained in:
Eli, wyldt- 2020-07-30 06:39:23 +02:00 committed by GitHub
parent b6434298fc
commit 03778e6f31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -53,7 +53,7 @@ class PlayerRescueTask implements Runnable
playerData.pendingTrapped = false;
//if the player moved three or more blocks from where he used /trapped, admonish him and don't save him
if (player.getLocation().distance(this.location) > 3)
if (!player.getLocation().getWorld().equals(this.location.getWorld()) || player.getLocation().distance(this.location) > 3)
{
GriefPrevention.sendMessage(player, TextMode.Err, Messages.RescueAbortedMoved);
return;