diff --git a/src/Jitter2/Collision/PairHashSet.cs b/src/Jitter2/Collision/PairHashSet.cs index 2c56331d..d6723adb 100644 --- a/src/Jitter2/Collision/PairHashSet.cs +++ b/src/Jitter2/Collision/PairHashSet.cs @@ -179,6 +179,7 @@ private void Resize(int size) public bool Add(Pair pair) { int hash = pair.GetHash(); + bool overwriteResult = false; try_again: @@ -193,7 +194,7 @@ public bool Add(Pair pair) if (slotPtr->ID == pair.ID) { - return false; + return overwriteResult; } if (slotPtr->ID == 0) @@ -204,6 +205,7 @@ public bool Add(Pair pair) if (originalSlots != Slots) { // Item was added to the wrong array. + overwriteResult = true; goto try_again; }