From c6e96b9b8e073c37813d7fbafb8cdec05112e59e Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Thu, 4 Apr 2019 22:55:27 -0400 Subject: [PATCH] v0.7.2b: adjusted rankings comparator to account for equal scores --- .../com/shatteredpixel/shatteredpixeldungeon/Rankings.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Rankings.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Rankings.java index c131357af..986aa51a2 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Rankings.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Rankings.java @@ -320,7 +320,12 @@ public enum Rankings { private static final Comparator scoreComparator = new Comparator() { @Override public int compare( Record lhs, Record rhs ) { - return (int)Math.signum( rhs.score - lhs.score ); + int result = (int)Math.signum( rhs.score - lhs.score ); + if (result == 0) { + return (int)Math.signum( rhs.gameID.hashCode() - lhs.gameID.hashCode()); + } else{ + return result; + } } }; }