Fixed fishing trawler teleport and random event issues

This commit is contained in:
Zerken
2023-10-17 11:02:12 +00:00
committed by Ryan
parent 5237051e71
commit 0e6b4ad816
3 changed files with 16 additions and 4 deletions
@@ -16,6 +16,7 @@ import core.game.node.entity.player.Player;
import core.game.node.entity.player.link.TeleportManager;
import core.game.node.entity.skill.Skills;
import core.game.system.task.Pulse;
import core.game.world.map.zone.ZoneRestriction;
import org.jetbrains.annotations.NotNull;
import core.game.world.GameWorld;
import core.game.world.map.Location;
@@ -928,7 +929,7 @@ public abstract class Entity extends Node {
* @return {@code True} if so.
*/
public boolean isTeleBlocked() {
return timers.getTimer("teleblock") != null || getLocks().isTeleportLocked();
return timers.getTimer("teleblock") != null || getLocks().isTeleportLocked() || getZoneMonitor().isRestricted(ZoneRestriction.TELEPORT);
}
/**
@@ -99,7 +99,7 @@ public class TeleportManager {
if (!entity.getZoneMonitor().teleport(teleportType, null)) {
return false;
}
if (teleportType != -1 && (entity.isTeleBlocked() || entity.getZoneMonitor().isRestricted(ZoneRestriction.TELEPORT))) {
if (teleportType != -1 && entity.isTeleBlocked()) {
if (entity.isPlayer())
entity.asPlayer().sendMessage("A magical force has stopped you from teleporting.");
return false;