1 QuestHelper_File
["collect_upgrade.lua"] = "Development Version"
2 QuestHelper_Loadtime
["collect_upgrade.lua"] = GetTime()
4 function QH_Collector_Upgrade(chunk
)
5 QuestHelper
: Assert(not chunk
.compressed
)
7 if chunk
.version
== 1 then
8 -- We basically just want to clobber all our old route data, it's not worth storing - it's all good data, it's just that we don't want to preserve relics of the old location system.
14 if chunk
.version
== 2 then
15 -- Originally I split the zones based on locale. Later I just split everything based on locale. Discarding old data rather than doing the gymnastics needed to preserve it.
16 -- This is turning into a routine. :D
22 if chunk
.version
== 3 then
23 -- Screwed up the item collection code in instances. Obliterate old data, try again.
25 for id
, dat
in pairs(chunk
.item
) do
34 if chunk
.version
== 4 then
35 -- Munged the shops rather badly. Whoopsydaisy.
38 for id
, dat
in pairs(chunk
.monster
) do
39 if type(dat
) == "table" then
49 if chunk
.version
== 5 then
50 -- Horrible things involving objects. Let's preserve what we can.
53 for k
, v
in pairs(chunk
.object
) do
55 for tk
, _
in pairs(v
) do
56 if type(tk
) == "string" and tk
:match("[a-z]+_loot") then
62 if keep
then new_obj
[k
] = v
end
65 chunk
.object
= new_obj
71 if chunk
.version
== 6 then
72 -- I just screwed this up really
73 -- Note that a few versions back (I'll have to check which) the standard bolus format changed. Since I can't actually *fix* it, I'm just ignoring it, but there's an implicit format change in there. I'll catch it and deal with it in the processing system.
75 chunk
.routing_dump
= nil -- and this shouldn't have been getting dumped anyway
80 if chunk
.version
== 7 then
81 -- botched the achievement code, fixed the achievement code (maybe?)
82 chunk
.achievement
= nil
88 function QH_Collector_UpgradeAll(Collector
)
89 -- So, I screwed up the compression code, and there's no way to know what version was compressed . . . except that we thankfully didn't change the version number on that change. Any untagged compression will therefore be the version number that this was loaded with.
90 for _
, v
in pairs(Collector
) do
91 QuestHelper
:Assert(type(v
) == "table")
93 QuestHelper
: Assert(QuestHelper_Collector_Version
) -- This is going to fail somehow. I just know it. Seriously, this right here will be proof that, today, the gods hate me.
94 v
.version
= QuestHelper_Collector_Version
97 if not v
.compressed
then
98 QH_Collector_Upgrade(v
)