forked from jsb/Gatherer
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdatabase.lua
31 lines (30 loc) · 1017 Bytes
/
database.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
-- Gatherer database related routines
--
function Gatherer_sanitizeDatabase(db)
-- type: (GathererDb) -> None
for continent, continentData in db do
for zone, zoneData in continentData do
for gather, gatherNodes in zoneData do
for nodeIndex, nodeInfo in gatherNodes do
if not nodeInfo.icon then
-- Due to l10n conflicts in old versions
-- syncs could produce buggy nodes without icon field.
-- Eliminate them.
Gatherer_ChatNotify(
'Detected empty icon:\n '..tostring(nodeInfo.icon),
Gatherer_ENotificationType.debug
)
Gatherer_ChatNotify(
'Decided to remove: '..table.concat({continent, zone, gather, nodeIndex}, ', '),
Gatherer_ENotificationType.debug
)
db[continent][zone][gather][nodeIndex] = nil
elseif type(nodeInfo.icon) == 'string' then
-- convert to IconIndex
db[continent][zone][gather][nodeIndex].icon = Gatherer_GetDB_IconIndex(nodeInfo.icon, nodeInfo.gtype)
end
end
end
end
end
end