summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2012-12-20 20:01:43 +0000
committerKHobbits <rob@khobbits.co.uk>2012-12-20 20:01:43 +0000
commit8f00aa55420e03b2c7bb2a91fa94429f3ecf4c3d (patch)
tree1decc815d1f54ddc1a1a8964ee8739b4175b4ed0
parentb2d68fe2134c6b6348aaea8b1856df9930d151c9 (diff)
downloadEssentials-8f00aa55420e03b2c7bb2a91fa94429f3ecf4c3d.tar
Essentials-8f00aa55420e03b2c7bb2a91fa94429f3ecf4c3d.tar.gz
Essentials-8f00aa55420e03b2c7bb2a91fa94429f3ecf4c3d.tar.lz
Essentials-8f00aa55420e03b2c7bb2a91fa94429f3ecf4c3d.tar.xz
Essentials-8f00aa55420e03b2c7bb2a91fa94429f3ecf4c3d.zip
Warn other party when teleport fails after tpaccept.
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java17
1 files changed, 13 insertions, 4 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java
index f15935053..7c950ae96 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java
@@ -1,5 +1,6 @@
package com.earth2me.essentials.commands;
+import com.earth2me.essentials.ChargeException;
import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.Trade;
import com.earth2me.essentials.User;
@@ -55,13 +56,21 @@ public class Commandtpaccept extends EssentialsCommand
user.sendMessage(_("requestAccepted"));
target.sendMessage(_("requestAcceptedFrom", user.getDisplayName()));
- if (user.isTpRequestHere())
+ try
{
- target.getTeleport().teleportToMe(user, charge, TeleportCause.COMMAND);
+ if (user.isTpRequestHere())
+ {
+ target.getTeleport().teleportToMe(user, charge, TeleportCause.COMMAND);
+ }
+ else
+ {
+ target.getTeleport().teleport(user, charge, TeleportCause.COMMAND);
+ }
}
- else
+ catch (ChargeException ex)
{
- target.getTeleport().teleport(user, charge, TeleportCause.COMMAND);
+ user.sendMessage(_("pendingTeleportCancelled"));
+ ess.showError(target, ex, commandLabel);
}
user.requestTeleport(null, false);
throw new NoChargeException();