summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2012-10-23 00:00:55 +0100
committerKHobbits <rob@khobbits.co.uk>2012-10-23 00:00:55 +0100
commit0bc33554f3332902d8df36ca02e142cc6149677b (patch)
tree17b3bee7cf64c740e730754f773bdb181506f5f5
parent7c480e88d651896eef2368b25f8da897334515b8 (diff)
downloadEssentials-0bc33554f3332902d8df36ca02e142cc6149677b.tar
Essentials-0bc33554f3332902d8df36ca02e142cc6149677b.tar.gz
Essentials-0bc33554f3332902d8df36ca02e142cc6149677b.tar.lz
Essentials-0bc33554f3332902d8df36ca02e142cc6149677b.tar.xz
Essentials-0bc33554f3332902d8df36ca02e142cc6149677b.zip
Fix tp delay message
-rw-r--r--Essentials/src/com/earth2me/essentials/Teleport.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/Essentials/src/com/earth2me/essentials/Teleport.java b/Essentials/src/com/earth2me/essentials/Teleport.java
index 6a666a199..5eba636d5 100644
--- a/Essentials/src/com/earth2me/essentials/Teleport.java
+++ b/Essentials/src/com/earth2me/essentials/Teleport.java
@@ -47,7 +47,7 @@ public class Teleport implements Runnable, ITeleport
private IUser teleportUser;
private int teleTimer = -1;
private long started; // time this task was initiated
- private long delay; // how long to delay the teleport
+ private long tpdelay; // how long to delay the teleport
private int health;
// note that I initially stored a clone of the location for reference, but...
// when comparing locations, I got incorrect mismatches (rounding errors, looked like)
@@ -69,7 +69,7 @@ public class Teleport implements Runnable, ITeleport
private void initTimer(long delay, IUser teleportUser, Target target, Trade chargeFor, TeleportCause cause)
{
this.started = System.currentTimeMillis();
- this.delay = delay;
+ this.tpdelay = delay;
this.health = teleportUser.getHealth();
this.initX = Math.round(teleportUser.getLocation().getX() * MOVE_CONSTANT);
this.initY = Math.round(teleportUser.getLocation().getY() * MOVE_CONSTANT);
@@ -107,7 +107,7 @@ public class Teleport implements Runnable, ITeleport
}
health = teleportUser.getHealth(); // in case user healed, then later gets injured
long now = System.currentTimeMillis();
- if (now > started + delay)
+ if (now > started + tpdelay)
{
try
{
@@ -273,7 +273,7 @@ public class Teleport implements Runnable, ITeleport
}
cancel(false);
- warnUser(user);
+ warnUser(user, delay);
initTimer((long)(delay * 1000.0), target, chargeFor, cause);
teleTimer = ess.scheduleSyncRepeatingTask(this, 10, 10);
@@ -303,13 +303,13 @@ public class Teleport implements Runnable, ITeleport
}
cancel(false);
- warnUser(otherUser);
+ warnUser(otherUser, delay);
initTimer((long)(delay * 1000.0), otherUser, target, chargeFor, cause);
teleTimer = ess.scheduleSyncRepeatingTask(this, 10, 10);
}
- private void warnUser(final IUser user)
+ private void warnUser(final IUser user, final double delay)
{
Calendar c = new GregorianCalendar();
c.add(Calendar.SECOND, (int)delay);
@@ -331,8 +331,8 @@ public class Teleport implements Runnable, ITeleport
public void warp(String warp, Trade chargeFor, TeleportCause cause) throws Exception
{
Location loc = ess.getWarps().getWarp(warp);
- teleport(new Target(loc), chargeFor, cause);
user.sendMessage(_("warpingTo", warp));
+ teleport(new Target(loc), chargeFor, cause);
}
//The back function is a wrapper used to teleport a player /back to their previous location.