From 020f4b456605dbf0cf0e8b61c4b81b2c4b974437 Mon Sep 17 00:00:00 2001 From: MobiusDevelopment <8391001+MobiusDevelopment@users.noreply.github.com> Date: Thu, 6 Feb 2020 15:09:25 +0000 Subject: [PATCH] Prohibit teleport while casting or in combat. --- .../gameserver/network/clientpackets/ExRequestTeleport.java | 4 ++-- .../gameserver/network/clientpackets/ExRequestTeleport.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/ExRequestTeleport.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/ExRequestTeleport.java index 6efa69e894..267e6be22c 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/ExRequestTeleport.java +++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/ExRequestTeleport.java @@ -56,8 +56,8 @@ public class ExRequestTeleport implements IClientIncomingPacket return; } - // Players should not be able to teleport out of special locations. - if (player.isInInstance() || player.isOnEvent() || player.isInOlympiadMode() || player.inObserverMode() || player.isInTraingCamp() || player.isInTimedHuntingZone()) + // Players should not be able to teleport if in combat, or in a special location. + if (player.isCastingNow() || player.isInCombat() || player.isInInstance() || player.isOnEvent() || player.isInOlympiadMode() || player.inObserverMode() || player.isInTraingCamp() || player.isInTimedHuntingZone()) { player.sendPacket(SystemMessageId.YOU_CANNOT_TELEPORT_RIGHT_NOW); return; diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/clientpackets/ExRequestTeleport.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/clientpackets/ExRequestTeleport.java index e800477d08..4ea894448c 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/clientpackets/ExRequestTeleport.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/clientpackets/ExRequestTeleport.java @@ -56,8 +56,8 @@ public class ExRequestTeleport implements IClientIncomingPacket return; } - // Players should not be able to teleport out of special locations. - if (player.isInInstance() || player.isOnEvent() || player.isInOlympiadMode() || player.inObserverMode() || player.isInTraingCamp() || player.isInTimedHuntingZone()) + // Players should not be able to teleport if in combat, or in a special location. + if (player.isCastingNow() || player.isInCombat() || player.isInInstance() || player.isOnEvent() || player.isInOlympiadMode() || player.inObserverMode() || player.isInTraingCamp() || player.isInTimedHuntingZone()) { player.sendMessage("You cannot teleport right now."); return;