Fix == operator causing crash

This commit is contained in:
BruceChen 2022-10-06 22:16:41 +08:00
parent e92f449749
commit a98438131f

View file

@ -295,15 +295,6 @@ namespace MinecraftClient.Mapping
return loc1.Equals(loc2); return loc1.Equals(loc2);
} }
public static bool operator ==(Location? loc1, Location? loc2)
{
if (loc1 == null && loc2 == null)
return true;
if (loc1 == null || loc2 == null)
return false;
return loc1.Equals(loc2);
}
/// <summary> /// <summary>
/// Compare two locations. Locations are not equals if the integer part of their coordinates are not equals. /// Compare two locations. Locations are not equals if the integer part of their coordinates are not equals.
/// </summary> /// </summary>
@ -315,15 +306,6 @@ namespace MinecraftClient.Mapping
return !loc1.Equals(loc2); return !loc1.Equals(loc2);
} }
public static bool operator !=(Location? loc1, Location? loc2)
{
if (loc1 == null && loc2 == null)
return false;
if (loc1 == null || loc2 == null)
return true;
return !loc1.Equals(loc2);
}
/// <summary> /// <summary>
/// Sums two locations and returns the result. /// Sums two locations and returns the result.
/// </summary> /// </summary>