Skip to content

Commit

Permalink
Quest equality needs to also check for thread name, rather than just …
Browse files Browse the repository at this point in the history
…Compare.
  • Loading branch information
Kinematics committed Apr 6, 2016
1 parent 9e4260c commit dc0ffef
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions TallyCore/Quests/Quest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit dc0ffef

Please sign in to comment.