From 198778ba2d50a95b663279aa60b708e4dbea2882 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Wed, 1 Jan 2025 21:41:48 -0600 Subject: [PATCH] arena circle addition --- src/engine/gameManager/ArenaManager.java | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) 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; + } }