From 9263b9edfcdbb7a69939dbcc5e4c930464254d12 Mon Sep 17 00:00:00 2001 From: Liza Carvelli Date: Tue, 7 Feb 2023 21:28:01 +0100 Subject: [PATCH] Add ScaleFactor to math, since some trap locations are too close to others --- Pal.Client/Pal.Client.csproj | 2 +- Pal.Common/PalaceMath.cs | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Pal.Client/Pal.Client.csproj b/Pal.Client/Pal.Client.csproj index d8c6a8d..dd5f9bf 100644 --- a/Pal.Client/Pal.Client.csproj +++ b/Pal.Client/Pal.Client.csproj @@ -3,7 +3,7 @@ net7.0-windows 11.0 - 2.5 + 2.6 enable diff --git a/Pal.Common/PalaceMath.cs b/Pal.Common/PalaceMath.cs index 2a7636e..3f685f0 100644 --- a/Pal.Common/PalaceMath.cs +++ b/Pal.Common/PalaceMath.cs @@ -4,13 +4,18 @@ namespace Pal.Common { public class PalaceMath { + private static readonly Vector3 ScaleFactor = new Vector3(5); + public static bool IsNearlySamePosition(Vector3 a, Vector3 b) { + a *= ScaleFactor; + b *= ScaleFactor; return (int)a.X == (int)b.X && (int)a.Y == (int)b.Y && (int)a.Z == (int)b.Z; } public static int GetHashCode(Vector3 v) { + v *= ScaleFactor; return HashCode.Combine((int)v.X, (int)v.Y, (int)v.Z); } }