From a52190233c7b2c38882566d992b7a3cad2d22efb Mon Sep 17 00:00:00 2001 From: Flavius Poenaru Date: Sun, 24 Sep 2023 04:39:18 -0600 Subject: [PATCH] fix(client): distance checking combat --- packages/client/src/network/connection.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/client/src/network/connection.ts b/packages/client/src/network/connection.ts index f4592e0529..9f3a98131e 100644 --- a/packages/client/src/network/connection.ts +++ b/packages/client/src/network/connection.ts @@ -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); }