diff --git a/src/engine/gameManager/ArenaManager.java b/src/engine/gameManager/ArenaManager.java index 40ab6030..17eb4eff 100644 --- a/src/engine/gameManager/ArenaManager.java +++ b/src/engine/gameManager/ArenaManager.java @@ -134,7 +134,7 @@ public class ArenaManager { loc = new Vector3fImmutable(x, y, z * -1); HashSet inRange = WorldGrid.getObjectsInRangePartial(loc,500f, MBServerStatics.MASK_PLAYER); - if(inRange.isEmpty()) + if(inRange.isEmpty() && !isUnderWater(loc)) locSet = true; //} }catch(Exception e){ @@ -144,4 +144,26 @@ public class ArenaManager { return loc; } + + public static boolean isUnderWater(Vector3fImmutable loc) { + + try { + + Zone zone = ZoneManager.findSmallestZone(loc); + + if (zone.getSeaLevel() != 0) { + + float localAltitude = loc.y; + if (localAltitude < zone.getSeaLevel()) + return true; + } else { + if (loc.y < 0) + return true; + } + } catch (Exception e) { + + } + + return false; + } }