Skip to content

Commit

Permalink
fix(client): distance checking combat
Browse files Browse the repository at this point in the history
  • Loading branch information
Veradictus committed Sep 24, 2023
1 parent 445e4f7 commit a521902
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions packages/client/src/network/connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -612,10 +612,9 @@ export default class Connection {

// 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)
attacker.isMob() &&
((attacker.gridX === target.gridX && attacker.gridY === target.gridY) ||
(attacker.getDistance(target!) > 2 && attacker.attackRange > 1))
)
this.game.findAdjacentTile(attacker);
}
Expand Down

0 comments on commit a521902

Please sign in to comment.