From 59fdb54a09034df1503ee832ccb46d0449f3da4a Mon Sep 17 00:00:00 2001 From: Tobias Ottenweller Date: Sun, 17 Feb 2013 13:11:16 +0100 Subject: [PATCH] Fixed a bug where an already closed gate got used for teleporting. --- src/de/craftinc/gates/listeners/BaseLocationListener.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/de/craftinc/gates/listeners/BaseLocationListener.java b/src/de/craftinc/gates/listeners/BaseLocationListener.java index a60299c..f31ed2e 100644 --- a/src/de/craftinc/gates/listeners/BaseLocationListener.java +++ b/src/de/craftinc/gates/listeners/BaseLocationListener.java @@ -25,7 +25,7 @@ public abstract class BaseLocationListener // Check if the gate is open and useable World gateWorld = g.getLocation().getWorld(); - if (g.isOpen() == false || !gateWorld.equals(playerWorld)) { + if (!g.isOpen() || !gateWorld.equals(playerWorld)) { continue; } @@ -37,11 +37,12 @@ public abstract class BaseLocationListener // Check if the gate is still valid try { g.validate(); + gate = g; break; } catch (Exception e2) { - // do nothing - gate is closed + break; // do nothing - gate got closed } } }