Fixed a bug where an already closed gate got used for teleporting.

This commit is contained in:
Tobias Ottenweller 2013-02-17 13:11:16 +01:00
parent 02b904a78d
commit 59fdb54a09

View File

@ -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
}
}
}