From 3e6655a1991b5d6f9e9ace445755607fc4c42b58 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Thu, 9 Jan 2025 18:02:04 -0600 Subject: [PATCH] cant change altitude while stunned --- src/engine/net/client/handlers/ChangeAltitudeHandler.java | 4 ++++ src/engine/objects/AbstractCharacter.java | 2 -- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/engine/net/client/handlers/ChangeAltitudeHandler.java b/src/engine/net/client/handlers/ChangeAltitudeHandler.java index db4a0e78..bd717e9f 100644 --- a/src/engine/net/client/handlers/ChangeAltitudeHandler.java +++ b/src/engine/net/client/handlers/ChangeAltitudeHandler.java @@ -9,6 +9,7 @@ package engine.net.client.handlers; +import engine.Enum; import engine.Enum.DispatchChannel; import engine.exception.MsgSendException; import engine.net.DispatchMessage; @@ -42,6 +43,9 @@ public class ChangeAltitudeHandler extends AbstractClientMsgHandler { if (!AbstractCharacter.CanFly(pc)) return false; + if(pc.getBonuses().getBool(Enum.ModType.Stunned, Enum.SourceType.None)) + return false; + if (pc.isSwimming()) return false; if (pc.region != null && !pc.region.isOutside()) diff --git a/src/engine/objects/AbstractCharacter.java b/src/engine/objects/AbstractCharacter.java index b804f834..532c753f 100644 --- a/src/engine/objects/AbstractCharacter.java +++ b/src/engine/objects/AbstractCharacter.java @@ -499,8 +499,6 @@ public abstract class AbstractCharacter extends AbstractWorldObject { if(flyer.effects.containsKey("MoveBuff")){ canFly = false; } - if(flyer.bonuses.getBool(ModType.Stunned, SourceType.None)) - canFly = false; return canFly;