Skip to content

Commit

Permalink
Can't duplicate in vis_contents (#1811)
Browse files Browse the repository at this point in the history
Co-authored-by: amylizzle <amylizzle@users.noreply.github.com>
  • Loading branch information
amylizzle and amylizzle authored May 25, 2024
1 parent dede5b1 commit 2ff5fae
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions OpenDreamRuntime/Objects/Types/DreamList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -823,9 +823,13 @@ public override void SetValue(DreamValue key, DreamValue value, bool allowGrowth
public override void AddValue(DreamValue value) {
EntityUid entity;
if (value.TryGetValueAsDreamObject<DreamObjectMovable>(out var movable)) {
if(_visContents.Contains(movable))
return; // vis_contents cannot contain duplicates
_visContents.Add(movable);
entity = movable.Entity;
} else if (value.TryGetValueAsDreamObject<DreamObjectTurf>(out var turf)) {
if(_visContents.Contains(turf))
return; // vis_contents cannot contain duplicates
_visContents.Add(turf);
entity = EntityUid.Invalid; // TODO: Support turfs in vis_contents
} else {
Expand Down

0 comments on commit 2ff5fae

Please sign in to comment.