Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Core/Game/Agents/AgentController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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();
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions Core/Game/Agents/LSAgent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion Core/Simulation/Math/Vector2d.cs
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ public long GetLongHashCode()
return x * 31 + y * 7;
}

public int GetStateHash()
public override int GetHashCode()
{
return (int)(GetLongHashCode() % int.MaxValue);
}
Expand Down