Skip to content
This repository was archived by the owner on Jul 13, 2025. It is now read-only.

Commit b143c59

Browse files
committed
Fix error from duplicate tag entries
1 parent 5b6556f commit b143c59

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

src/TagManager.lua

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ function TagManager.new(store)
6666
nameChangedSignals = {},
6767
tags = {},
6868
onUpdate = {},
69+
_gaveDuplicateWarningsFor = {},
6970
}, TagManager)
7071

7172
TagManager._global = self
@@ -220,15 +221,30 @@ end
220221

221222
function TagManager:_doUpdateStore()
222223
self.updateTriggered = false
223-
local tags: { [number]: Tag } = {}
224+
local tags: { Tag } = {}
224225
local groups: { [string]: boolean } = {}
225226
local sel = Selection:Get()
227+
local tagNamesSeen: { [string]: boolean } = {}
226228

227229
if self.tagsFolder then
228230
for _, inst in pairs(self.tagsFolder:GetChildren()) do
229231
if not inst:IsA("Configuration") then
230232
continue
231233
end
234+
if tagNamesSeen[inst.Name] then
235+
if not self._gaveDuplicateWarningsFor[inst.Name] then
236+
warn(
237+
string.format(
238+
"Multiple tags in ServerStorage.TagList are named %q, consider removing the duplicates.",
239+
inst.Name
240+
)
241+
)
242+
self._gaveDuplicateWarningsFor[inst.Name] = true
243+
end
244+
continue
245+
end
246+
tagNamesSeen[inst.Name] = true
247+
232248
local hasAny = false
233249
local missingAny = false
234250
local entry: Tag = {

0 commit comments

Comments
 (0)