Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions OpenDreamRuntime/DreamValue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -455,11 +455,13 @@
case DreamValueType.DreamObject: {
Debug.Assert(_refValue is DreamObject or null, "Failed to cast _refValue to DreamObject");
Debug.Assert(other._refValue is DreamObject or null, "Failed to cast other._refValue to DreamObject");
if (_refValue != null && Unsafe.As<DreamObject>(_refValue).Deleted)
var thisObj = Unsafe.As<DreamObject>(_refValue);
var otherObj = Unsafe.As<DreamObject>(other._refValue);
if (thisObj != null && thisObj.Deleted == true)
_refValue = null;
if (other._refValue != null && Unsafe.As<DreamObject>(other._refValue).Deleted)
if (otherObj != null && otherObj.Deleted == true)
other._refValue = null;
break;
return thisObj == otherObj;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this not break comparisons with deleted objects? It compares _refValue before the Deleted check.

}
}

Expand Down
4 changes: 3 additions & 1 deletion OpenDreamRuntime/Objects/Types/DreamList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,9 @@ public virtual void AddValue(DreamValue value) {

//Does not include associations
public virtual bool ContainsValue(DreamValue value) {
for (int i = 0; i < _values.Count; i++) {
var count = _values.Count;

for (int i = 0; i < count; i++) {
if (_values[i].Equals(value))
return true;
}
Expand Down
Loading