Skip to content

Commit 185da98

Browse files
committed
Bugfix: Reduce dancing during combat
1 parent 4349c07 commit 185da98

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/main/java/io/luna/game/model/mob/combat/CombatAction.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,16 @@ public boolean run() {
9999
Position position = mob.getPosition();
100100
CollisionManager collisionManager = mob.getWorld().getCollisionManager();
101101
InteractionPolicy interactionPolicy = combat.computeInteractionPolicy();
102-
if (!collisionManager.reached(position, target, interactionPolicy)) {
102+
boolean reachedTarget = collisionManager.reached(position, target, interactionPolicy);
103+
if (!reachedTarget) {
103104
if (mob.getWalking().isEmpty()) {
104105
mob.getNavigator().walkTo(target, Optional.empty(), false);
105106
}
106107
return false;
108+
} else {
109+
if (!mob.getWalking().isEmpty()) {
110+
mob.getWalking().clear();
111+
}
107112
}
108113

109114
// TODO Players shouldn't be allowed to attack at all if on the same position? Unless it's magic/ranged?

0 commit comments

Comments
 (0)