Skip to content

Commit

Permalink
fix(client): targeting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Veradictus committed Sep 24, 2023
1 parent 703340a commit 115006b
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions packages/client/src/network/connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -608,14 +608,10 @@ export default class Connection {

// Add the attacker to the target's list of attackers.
target.addAttacker(attacker);
attacker.setTarget(target);
//attacker.setTarget(target);

// Ensure the attacker and the target are not on the same tile and just move them.
if (
attacker.isMob() &&
((attacker.gridX === target.gridX && attacker.gridY === target.gridY) ||
(attacker.getDistance(target!) > 2 && attacker.attackRange > 1))
)
if (attacker.isMob() && attacker.gridX === target.gridX && attacker.gridY === target.gridY)
this.game.findAdjacentTile(attacker);
}

Expand Down

0 comments on commit 115006b

Please sign in to comment.