Browse Source

arena circle addition

lakebane2
FatBoy-DOTC 2 weeks ago
parent
commit
198778ba2d
  1. 24
      src/engine/gameManager/ArenaManager.java

24
src/engine/gameManager/ArenaManager.java

@ -134,7 +134,7 @@ public class ArenaManager {
loc = new Vector3fImmutable(x, y, z * -1); loc = new Vector3fImmutable(x, y, z * -1);
HashSet<AbstractWorldObject> inRange = WorldGrid.getObjectsInRangePartial(loc,500f, MBServerStatics.MASK_PLAYER); HashSet<AbstractWorldObject> inRange = WorldGrid.getObjectsInRangePartial(loc,500f, MBServerStatics.MASK_PLAYER);
if(inRange.isEmpty()) if(inRange.isEmpty() && !isUnderWater(loc))
locSet = true; locSet = true;
//} //}
}catch(Exception e){ }catch(Exception e){
@ -144,4 +144,26 @@ public class ArenaManager {
return loc; 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;
}
} }

Loading…
Cancel
Save