Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't duplicate in vis_contents #1811

Merged
merged 1 commit into from
May 25, 2024
Merged
Changes from all commits
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
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
Loading