Skip to content

Commit

Permalink
Fix Terraria violation of comparison contract.
Browse files Browse the repository at this point in the history
  • Loading branch information
Chicken-Bones committed Feb 25, 2018
1 parent b935a7f commit 257b3a5
Showing 1 changed file with 225 additions and 0 deletions.
225 changes: 225 additions & 0 deletions patches/tModLoader/Terraria.UI/ItemSorting.cs.patch
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,231 @@

namespace Terraria.UI
{
@@ -52,7 +_,7 @@
int num = inv[y].rare.CompareTo(inv[x].rare);
if (num == 0)
{
- num = ((x == y) ? 0 : -1);
+ num = x.CompareTo(y);
}
return num;
});
@@ -73,7 +_,7 @@
int num = inv[y].rare.CompareTo(inv[x].rare);
if (num == 0)
{
- num = ((x == y) ? 0 : -1);
+ num = x.CompareTo(y);
}
return num;
});
@@ -94,7 +_,7 @@
int num = inv[y].rare.CompareTo(inv[x].rare);
if (num == 0)
{
- num = ((x == y) ? 0 : -1);
+ num = x.CompareTo(y);
}
return num;
});
@@ -115,7 +_,7 @@
int num = inv[y].rare.CompareTo(inv[x].rare);
if (num == 0)
{
- num = ((x == y) ? 0 : -1);
+ num = x.CompareTo(y);
}
return num;
});
@@ -136,7 +_,7 @@
int num = inv[y].rare.CompareTo(inv[x].rare);
if (num == 0)
{
- num = ((x == y) ? 0 : -1);
+ num = x.CompareTo(y);
}
return num;
});
@@ -157,7 +_,7 @@
int num = inv[y].rare.CompareTo(inv[x].rare);
if (num == 0)
{
- num = ((x == y) ? 0 : -1);
+ num = x.CompareTo(y);
}
return num;
});
@@ -178,7 +_,7 @@
int num = inv[y].rare.CompareTo(inv[x].rare);
if (num == 0)
{
- num = ((x == y) ? 0 : -1);
+ num = x.CompareTo(y);
}
return num;
});
@@ -268,7 +_,7 @@
}
if (num == 0)
{
- num = ((x == y) ? 0 : -1);
+ num = x.CompareTo(y);
}
return num;
});
@@ -289,7 +_,7 @@
int num = inv[y].rare.CompareTo(inv[x].rare);
if (num == 0)
{
- num = ((x == y) ? 0 : -1);
+ num = x.CompareTo(y);
}
return num;
});
@@ -381,7 +_,7 @@
}
if (num == 0)
{
- num = ((x == y) ? 0 : -1);
+ num = x.CompareTo(y);
}
return num;
});
@@ -406,7 +_,7 @@
}
if (num == 0)
{
- num = ((x == y) ? 0 : -1);
+ num = x.CompareTo(y);
}
return num;
});
@@ -431,7 +_,7 @@
}
if (num == 0)
{
- num = ((x == y) ? 0 : -1);
+ num = x.CompareTo(y);
}
return num;
});
@@ -456,7 +_,7 @@
}
if (num == 0)
{
- num = ((x == y) ? 0 : -1);
+ num = x.CompareTo(y);
}
return num;
});
@@ -481,7 +_,7 @@
}
if (num == 0)
{
- num = ((x == y) ? 0 : -1);
+ num = x.CompareTo(y);
}
return num;
});
@@ -549,7 +_,7 @@
}
if (num == 0)
{
- num = ((x == y) ? 0 : -1);
+ num = x.CompareTo(y);
}
return num;
});
@@ -578,7 +_,7 @@
}
if (num == 0)
{
- num = ((x == y) ? 0 : -1);
+ num = x.CompareTo(y);
}
return num;
});
@@ -607,7 +_,7 @@
}
if (num == 0)
{
- num = ((x == y) ? 0 : -1);
+ num = x.CompareTo(y);
}
return num;
});
@@ -632,7 +_,7 @@
}
if (num == 0)
{
- num = ((x == y) ? 0 : -1);
+ num = x.CompareTo(y);
}
return num;
});
@@ -665,7 +_,7 @@
}
if (num == 0)
{
- num = ((x == y) ? 0 : -1);
+ num = x.CompareTo(y);
}
return num;
});
@@ -720,7 +_,7 @@
}
if (num == 0)
{
- num = ((x == y) ? 0 : -1);
+ num = x.CompareTo(y);
}
return num;
});
@@ -762,7 +_,7 @@
}
if (num == 0)
{
- num = ((x == y) ? 0 : -1);
+ num = x.CompareTo(y);
}
return num;
});
@@ -787,7 +_,7 @@
}
if (num == 0)
{
- num = ((x == y) ? 0 : -1);
+ num = x.CompareTo(y);
}
return num;
});
@@ -812,7 +_,7 @@
}
if (num == 0)
{
- num = ((x == y) ? 0 : -1);
+ num = x.CompareTo(y);
}
return num;
});
@@ -841,7 +_,7 @@
}
if (num == 0)
{
- num = ((x == y) ? 0 : -1);
+ num = x.CompareTo(y);
}
return num;
});
@@ -864,7 +_,7 @@
}
if (num == 0)
{
- num = ((x == y) ? 0 : -1);
+ num = x.CompareTo(y);
}
return num;
});
@@ -920,7 +_,7 @@
list.Add(ItemSorting.ItemSortingLayers.LastTilesCommon);
list.Add(ItemSorting.ItemSortingLayers.LastNotTrash);
Expand Down

0 comments on commit 257b3a5

Please sign in to comment.