From dc0ffef27687d872b0f1263dfecb6496a665e514 Mon Sep 17 00:00:00 2001 From: David Smith Date: Wed, 6 Apr 2016 15:43:18 -0500 Subject: [PATCH] Quest equality needs to also check for thread name, rather than just Compare. --- TallyCore/Quests/Quest.cs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/TallyCore/Quests/Quest.cs b/TallyCore/Quests/Quest.cs index e9fe5509..6d5b780a 100644 --- a/TallyCore/Quests/Quest.cs +++ b/TallyCore/Quests/Quest.cs @@ -441,10 +441,17 @@ public override bool Equals(object obj) { IQuest other = obj as IQuest; if (ReferenceEquals(other, null)) - { return false; - } - return Compare(this, other) == 0; + + if (ReferenceEquals(this, other)) + return true; + + if (string.Compare(CultureInfo.InvariantCulture.TextInfo.ToLower(ThreadName), + CultureInfo.InvariantCulture.TextInfo.ToLower(other.ThreadName), StringComparison.Ordinal) != 0) + return false; + + return string.Compare(CultureInfo.InvariantCulture.TextInfo.ToLower(DisplayName), + CultureInfo.InvariantCulture.TextInfo.ToLower(other.DisplayName), StringComparison.Ordinal) == 0; } public override int GetHashCode() => DisplayName.GetHashCode();