Skip to content

Commit c40aa54

Browse files
authored
* Update to GetHashCode fix AscensionGameDev#1716 * Update to GetHashCode fix AscensionGameDev#1716 2 * Update to GetHashCode fix AscensionGameDev#1716 3
1 parent 14ddb3f commit c40aa54

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Intersect (Core)/GameObjects/LightBase.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Color color
6868
/// <returns></returns>
6969
public override int GetHashCode()
7070
{
71-
return Intensity ^ (int)Expand ^ (Color?.GetHashCode() ?? 0);
71+
return HashCode.Combine(Intensity, Expand, Color, TileX, TileY);
7272
}
7373

7474
/// <summary>
@@ -80,7 +80,7 @@ public override bool Equals(object obj)
8080
{
8181
if (obj is LightBase light)
8282
{
83-
return Intensity == light.Intensity && Color == light.Color&& Expand == light.Expand;
83+
return Intensity == light.Intensity && Color == light.Color && Expand == light.Expand && TileX == light.TileX && TileY == light.TileY;
8484
}
8585

8686
return false;

0 commit comments

Comments
 (0)