diff --git a/Core/Game/Agents/AgentController.cs b/Core/Game/Agents/AgentController.cs index 749db71f..d09a6e14 100644 --- a/Core/Game/Agents/AgentController.cs +++ b/Core/Game/Agents/AgentController.cs @@ -216,7 +216,7 @@ public static int GetStateHash() if (GlobalAgentActive [i]) { LSAgent agent = GlobalAgents [i]; - int n1 = agent.Body._position.GetStateHash() + agent.Body._rotation.GetStateHash(); + int n1 = agent.Body._position.GetHashCode() + agent.Body._rotation.GetHashCode(); switch (operationToggle) { case 0: @@ -236,8 +236,8 @@ public static int GetStateHash() } if (agent.Body.IsNotNull()) { - hash ^= agent.Body._position.GetStateHash(); - hash ^= agent.Body._position.GetStateHash(); + hash ^= agent.Body._position.GetHashCode(); + hash ^= agent.Body._position.GetHashCode(); } } } diff --git a/Core/Game/Agents/LSAgent.cs b/Core/Game/Agents/LSAgent.cs index 2e4f03fe..6b23e18e 100644 --- a/Core/Game/Agents/LSAgent.cs +++ b/Core/Game/Agents/LSAgent.cs @@ -423,9 +423,9 @@ public long GetStateHash () { long hash = 3; hash ^= this.GlobalID; hash ^= this.LocalID; - hash ^= this.Body._position.GetStateHash (); - hash ^= this.Body._rotation.GetStateHash (); - hash ^= this.Body.Velocity.GetStateHash (); + hash ^= this.Body._position.GetHashCode (); + hash ^= this.Body._rotation.GetHashCode (); + hash ^= this.Body.Velocity.GetHashCode (); return hash; } diff --git a/Core/Simulation/Math/Vector2d.cs b/Core/Simulation/Math/Vector2d.cs index 0c495539..30933453 100644 --- a/Core/Simulation/Math/Vector2d.cs +++ b/Core/Simulation/Math/Vector2d.cs @@ -452,7 +452,7 @@ public long GetLongHashCode() return x * 31 + y * 7; } - public int GetStateHash() + public override int GetHashCode() { return (int)(GetLongHashCode() % int.MaxValue); }