|
|
@ -1535,27 +1535,50 @@ public class PlayerCharacter extends AbstractCharacter { |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
Zone zone = ZoneManager.findSmallestZone(breather.getLoc()); |
|
|
|
Zone zone = ZoneManager.findSmallestZone(breather.getLoc()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(zone == null) |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(zone.isPlayerCity()) |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
float seaLevel = zone.getSeaLevel(); |
|
|
|
|
|
|
|
|
|
|
|
if (zone.getSeaLevel() != 0) { |
|
|
|
if (zone.getSeaLevel() != 0) { |
|
|
|
|
|
|
|
Zone parent = zone.getParent(); |
|
|
|
|
|
|
|
if(parent != null && parent.isMacroZone()){ |
|
|
|
|
|
|
|
float parentLevel = parent.getSeaLevel(); |
|
|
|
|
|
|
|
seaLevel -= parentLevel; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
float localAltitude = breather.getLoc().y; |
|
|
|
if(seaLevel == 0) |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
float localAltitude = breather.getLoc().y; |
|
|
|
|
|
|
|
float characterHeight = breather.characterHeight; |
|
|
|
|
|
|
|
|
|
|
|
if (localAltitude + breather.characterHeight < zone.getSeaLevel() - 2) |
|
|
|
if (localAltitude + characterHeight < seaLevel - 2) { |
|
|
|
|
|
|
|
//ChatManager.chatSystemInfo(breather, "YOU CANNOT BREATHE!");
|
|
|
|
return false; |
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
if (breather.isMoving()) { |
|
|
|
if (breather.isMoving()) { |
|
|
|
if (localAltitude + breather.characterHeight < zone.getSeaLevel()) |
|
|
|
if (localAltitude + breather.characterHeight < zone.getSeaLevel()) { |
|
|
|
|
|
|
|
//ChatManager.chatSystemInfo(breather, "YOU CANNOT BREATHE!");
|
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
if (breather.getLoc().y + breather.characterHeight < -2) |
|
|
|
if (breather.getLoc().y + breather.characterHeight < -2) { |
|
|
|
|
|
|
|
//ChatManager.chatSystemInfo(breather, "YOU CANNOT BREATHE!");
|
|
|
|
return false; |
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (breather.isMoving()) { |
|
|
|
if (breather.isMoving()) { |
|
|
|
if (breather.getLoc().y + breather.characterHeight < 0) |
|
|
|
if (breather.getLoc().y + breather.characterHeight < 0) { |
|
|
|
|
|
|
|
//ChatManager.chatSystemInfo(breather, "YOU CANNOT BREATHE!");
|
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
@ -5083,6 +5106,12 @@ public class PlayerCharacter extends AbstractCharacter { |
|
|
|
|
|
|
|
|
|
|
|
Zone zone = ZoneManager.findSmallestZone(this.getLoc()); |
|
|
|
Zone zone = ZoneManager.findSmallestZone(this.getLoc()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(zone == null) |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(zone.isPlayerCity()) |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
|
|
if (zone.getSeaLevel() != 0) { |
|
|
|
if (zone.getSeaLevel() != 0) { |
|
|
|
|
|
|
|
|
|
|
|
float localAltitude = this.getLoc().y + this.centerHeight; |
|
|
|
float localAltitude = this.getLoc().y + this.centerHeight; |
|
|
|