1
0
Bifurcation 0
Ce dépôt a été archivé le 2020-03-15. Vous pouvez voir ses fichiers ou le cloner, mais pas ouvrir de ticket ou de demandes d'ajout, ni soumettre de changements.
questhelperredux/QuestHelper/collect_merger.lua
Nathanial.C.Jones 965e8589c9 Everything SEEMS to work, less of course the db. Something I did before screwed everything up.
I implemented a QuestHelper_GetTime function for the next time Blizzard decides to fiddle with the time functions. It returns debugprofilestop() / 1000, to exactly match the precision of GetTime().

I also re-removed references to Cartographer from the rollback.
2012-01-01 03:01:18 +00:00

28 lignes
867 o
Lua

local GetTime = QuestHelper_GetTime
QuestHelper_File["collect_merger.lua"] = "4.0.1.$svnversion$"
QuestHelper_Loadtime["collect_merger.lua"] = GetTime()
local function Add(self, data, stoprepeat) -- NOTE: if you're getting errors about adding tables, you probably did Merger:Add instead of Merger.Add
if stoprepeat and #self > 0 and string.sub(self[#self], -#data) == data then return end
table.insert(self, data)
for i = #self - 1, 1, -1 do
if string.len(self[i]) > string.len(self[i + 1]) then break end
self[i] = self[i] .. table.remove(self, i + 1)
end
end
local function Finish(self, data)
for i = #self - 1, 1, -1 do
self[i] = self[i] .. table.remove(self)
end
return self[1] or ""
end
QH_Merger_Add = Add
QH_Merger_Finish = Finish
function QH_Collect_Merger_Init(_, API)
API.Utility_Merger = {Add = Add, Finish = Finish}
end