Fix regression in /tpaccept (#3567)

d9bf099c3d introduced a regression where `/tpaccept` no longer unconditionally cancels the teleportation request when it is accepted. This restores the previous request cancellation behaviour.

Fixes #3563.
This commit is contained in:
MD 2020-08-04 16:20:24 +01:00 committed by GitHub
commit 1ef4e15a4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 5 deletions

View File

@ -56,11 +56,6 @@ public class Commandtpaccept extends EssentialsCommand {
user.sendMessage(tl("pendingTeleportCancelled"));
return false;
});
future.thenAccept(success -> {
if (success) {
user.requestTeleport(null, false);
}
});
if (user.isTpRequestHere()) {
final Location loc = user.getTpRequestLocation();
AsyncTeleport teleport = (AsyncTeleport) requester.getAsyncTeleport();
@ -76,6 +71,7 @@ public class Commandtpaccept extends EssentialsCommand {
teleport.setTpType(AsyncTeleport.TeleportType.TPA);
teleport.teleport(user.getBase(), charge, TeleportCause.COMMAND, future);
}
user.requestTeleport(null, false);
}
}