From 52eaadc5024c3cd0468141932591099a4399897a Mon Sep 17 00:00:00 2001 From: amylizzle Date: Sat, 25 May 2024 16:55:23 +0100 Subject: [PATCH] can't duplicate in vis_contents --- OpenDreamRuntime/Objects/Types/DreamList.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/OpenDreamRuntime/Objects/Types/DreamList.cs b/OpenDreamRuntime/Objects/Types/DreamList.cs index f5527a253e..65df849080 100644 --- a/OpenDreamRuntime/Objects/Types/DreamList.cs +++ b/OpenDreamRuntime/Objects/Types/DreamList.cs @@ -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(out var movable)) { + if(_visContents.Contains(movable)) + return; // vis_contents cannot contain duplicates _visContents.Add(movable); entity = movable.Entity; } else if (value.TryGetValueAsDreamObject(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 {