mirror of
https://github.com/Dadido3/noita-mapcap.git
synced 2024-11-18 17:17:31 +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",
|
Type = "warning",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
-- Create or append to list of modifications.
|
||||||
|
-- We have to prevent duplicate entries.
|
||||||
self.List["ModificationFailed"].ModificationEntries = self.List["ModificationFailed"].ModificationEntries or {}
|
self.List["ModificationFailed"].ModificationEntries = self.List["ModificationFailed"].ModificationEntries or {}
|
||||||
|
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})
|
table.insert(self.List["ModificationFailed"].ModificationEntries, {realm = realm, name = name, value = value})
|
||||||
|
end
|
||||||
|
|
||||||
-- Build message lines.
|
-- Build message lines.
|
||||||
self.List["ModificationFailed"].Lines = {"The mod couldn't apply the following changes:"}
|
self.List["ModificationFailed"].Lines = {"The mod couldn't apply the following changes:"}
|
||||||
|
Loading…
Reference in New Issue
Block a user