mirror of
https://github.com/Dadido3/noita-mapcap.git
synced 2024-12-22 02:17:33 +00:00
Prevent duplicate modification entries in message
This commit is contained in:
parent
45df692b96
commit
24a1615706
@ -192,8 +192,19 @@ function Message:ShowModificationUnsupported(realm, name, value)
|
||||
Type = "warning",
|
||||
}
|
||||
|
||||
-- Create or append to list of modifications.
|
||||
-- We have to prevent duplicate entries.
|
||||
self.List["ModificationFailed"].ModificationEntries = self.List["ModificationFailed"].ModificationEntries or {}
|
||||
table.insert(self.List["ModificationFailed"].ModificationEntries, {realm = realm, name = name, value = value})
|
||||
local found
|
||||
for _, modEntry in ipairs(self.List["ModificationFailed"].ModificationEntries) do
|
||||
if modEntry.realm == realm and modEntry.name == name then
|
||||
found = true
|
||||
break
|
||||
end
|
||||
end
|
||||
if not found then
|
||||
table.insert(self.List["ModificationFailed"].ModificationEntries, {realm = realm, name = name, value = value})
|
||||
end
|
||||
|
||||
-- Build message lines.
|
||||
self.List["ModificationFailed"].Lines = {"The mod couldn't apply the following changes:"}
|
||||
|
Loading…
Reference in New Issue
Block a user