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_zone.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

66 lignes
1,9 Kio
Lua

local GetTime = QuestHelper_GetTime
QuestHelper_File["collect_zone.lua"] = "4.0.1.$svnversion$"
QuestHelper_Loadtime["collect_zone.lua"] = GetTime()
local debug_output = false
if QuestHelper_File["collect_zone.lua"] == "Development Version" then debug_output = true end
local QHCZ
local GetLoc
local Merger
local function DoZoneUpdate(label, debugverbose)
local zname = string.format("%s@@%s@@%s", GetZoneText(), GetRealZoneText(), GetSubZoneText()) -- I don't *think* any zones will have a @@ in them :D
if zname == "@@@@" then return end -- denied
if not QHCZ[zname] then QHCZ[zname] = {} end
if not QHCZ[zname][label] then QHCZ[zname][label] = {} end
local znl = QHCZ[zname][label]
if debugverbose and debug_output then
--QuestHelper:TextOut("zoneupdate " .. zname .. " type " .. label)
end
QHCZ[zname].mapname = GetMapInfo()
local loc = GetLoc()
if loc.delayed == 128 and loc.c == 0 and loc.z == 0 and loc.x == -128 and loc.y == -128 then return end
--if loc == "€\000\000\000€\000\000\000€€€" then return end -- this is kind of the "null value"
local found = false
-- Commented out, 'cause this module isn't really loaded anymore. I'll remove it after the next commit.
--Merger.Add(znl, loc, true)
end
local function OnEvent()
DoZoneUpdate("border", true)
end
local lastupdate = 0
local function OnUpdate()
if lastupdate + 15 <= GetTime() then
DoZoneUpdate("update")
lastupdate = GetTime()
end
end
function QH_Collect_Zone_Init(QHCData, API)
do return end -- we really don't need this anymore
if not QHCData.zone then QHCData.zone = {} end
QHCZ = QHCData.zone
QH_Event("ZONE_CHANGED", OnEvent)
QH_Event("ZONE_CHANGED_INDOORS", OnEvent)
QH_Event("ZONE_CHANGED_NEW_AREA", OnEvent)
--API.Registrar_OnUpdateHook(OnUpdate)
GetLoc = API.Callback_LocationBolusCurrent
QuestHelper: Assert(GetLoc)
Merger = API.Utility_Merger
QuestHelper: Assert(Merger)
end