From fa0c47c9fb422e333601b99c545f28d3bde61816 Mon Sep 17 00:00:00 2001 From: Corentin Date: Sun, 18 Feb 2024 18:12:38 +0000 Subject: [PATCH] Fix the error in the distance calculation function (#58) Reviewed-on: https://git.tipragot.fr/corentin/border-wars/pulls/58 Reviewed-by: Tipragot --- crates/border-wars/src/map/hex.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/border-wars/src/map/hex.rs b/crates/border-wars/src/map/hex.rs index 5410eff..f94e292 100644 --- a/crates/border-wars/src/map/hex.rs +++ b/crates/border-wars/src/map/hex.rs @@ -256,7 +256,7 @@ impl HexPosition { size.0 * 3f32 .sqrt() - .mul_add(T::to_f32(self.0), 3f32.sqrt() / 2.0 * T::to_f32(self.0)), + .mul_add(T::to_f32(self.0), 3f32.sqrt() / 2.0 * T::to_f32(self.1)), size.1 * (3.0 / 2.0 * T::to_f32(self.1)), ) }