From cd74bb46b10fe6cb9987ec48a6ab1d413aef3a1c Mon Sep 17 00:00:00 2001 From: dam <27978131-real_damighty@users.noreply.gitlab.com> Date: Sat, 13 Jun 2026 03:09:18 +0300 Subject: [PATCH] Some ContentAPI usage --- .../core/game/interaction/MovementPulse.java | 2 +- .../entity/combat/CombatMovementIntents.kt | 21 +++++++++++-------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/Server/src/main/core/game/interaction/MovementPulse.java b/Server/src/main/core/game/interaction/MovementPulse.java index dc1862a3c..97fc86810 100644 --- a/Server/src/main/core/game/interaction/MovementPulse.java +++ b/Server/src/main/core/game/interaction/MovementPulse.java @@ -250,7 +250,7 @@ public abstract class MovementPulse extends Pulse { if (near || pulse()) { if (mover instanceof Player) { if (near) { - ((Player) mover).getPacketDispatch().sendMessage("I can't reach that."); + sendMessage((Player) mover, "I can't reach that."); } PacketRepository.send(ClearMinimapFlag.class, new PlayerContext((Player) mover)); } diff --git a/Server/src/main/core/game/node/entity/combat/CombatMovementIntents.kt b/Server/src/main/core/game/node/entity/combat/CombatMovementIntents.kt index 72be3f4f3..f50c1a507 100644 --- a/Server/src/main/core/game/node/entity/combat/CombatMovementIntents.kt +++ b/Server/src/main/core/game/node/entity/combat/CombatMovementIntents.kt @@ -1,6 +1,9 @@ package core.game.node.entity.combat import core.ServerConstants +import core.api.face +import core.api.sendMessage +import core.api.stopWalk import core.game.container.impl.EquipmentContainer import core.game.node.Node import core.game.node.entity.Entity @@ -273,15 +276,15 @@ object CombatMovementIntents { attacker, target, attacker.location, projectedTargetLocation, trace ) ) { - attacker.walkingQueue.reset() - attacker.face(target) + stopWalk(attacker) + face(attacker, target) projectedLocations[attacker] = attacker.location reserveOccupiedTiles(reservedTiles, attacker, attacker.location) return } if (canAttackFrom(attacker, target, attacker.location, targetLocation, trace)) { - attacker.walkingQueue.reset() - attacker.face(target) + stopWalk(attacker) + face(attacker, target) projectedLocations[attacker] = attacker.location reserveOccupiedTiles(reservedTiles, attacker, attacker.location) return @@ -298,7 +301,7 @@ object CombatMovementIntents { return } walkPath(attacker, attackPath) - attacker.face(target) + face(attacker, target) projectedLocations[attacker] = attackPath.projectedLocation reserveOccupiedTiles(reservedTiles, attacker, attackPath.projectedLocation) return @@ -313,7 +316,7 @@ object CombatMovementIntents { attacker, target, projectedAttackerLocation, targetLocation, trace ) ) { - attacker.face(target) + face(attacker, target) projectedLocations[attacker] = projectedAttackerLocation reserveOccupiedTiles(reservedTiles, attacker, projectedAttackerLocation) return @@ -334,7 +337,7 @@ object CombatMovementIntents { } walkPath(attacker, attackPath) - attacker.face(target) + face(attacker, target) projectedLocations[attacker] = attackPath.projectedLocation reserveOccupiedTiles(reservedTiles, attacker, attackPath.projectedLocation) return @@ -1111,9 +1114,9 @@ object CombatMovementIntents { @JvmStatic fun stopUnreachableCombat(attacker: Entity) { attacker.properties.combatPulse.stop() - attacker.walkingQueue.reset() + stopWalk(attacker) if (attacker is Player) { - attacker.packetDispatch.sendMessage("I can't reach that!") + sendMessage(attacker, "I can't reach that!") } }