arena circle addition

This commit is contained in:
2025-01-01 21:41:48 -06:00
parent 215aabdc5f
commit 198778ba2d
+23 -1
View File
@@ -134,7 +134,7 @@ public class ArenaManager {
loc = new Vector3fImmutable(x, y, z * -1);
HashSet<AbstractWorldObject> 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;
}
}