965e8589c9
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.
24 lignes
938 o
Lua
24 lignes
938 o
Lua
|
|
local GetTime = QuestHelper_GetTime
|
|
|
|
QuestHelper_File["routing_route.lua"] = "4.0.1.$svnversion$"
|
|
QuestHelper_Loadtime["routing_route.lua"] = GetTime()
|
|
|
|
-- Real simple - [1] through [N] is our route. Yes, the player position at the time the route was generated is [1]. There will be route manipulation functions later. I hear that metatables don't have per-table overhead, but do have some CPU use. I've heard this might only occur if the member doesn't exist inside the actual table. I've also heard that both of these might be wrong. I obviously need to research this since the people in #lua are being useless.
|
|
|
|
function NewRoute()
|
|
return QuestHelper:CreateTable("route")
|
|
end
|
|
|
|
function PathToString(path)
|
|
local dout
|
|
for _, v in ipairs(path) do
|
|
if dout then
|
|
dout = dout .. string.format(", %d", v)
|
|
else
|
|
dout = string.format("%d", v)
|
|
end
|
|
end
|
|
|
|
return string.format("[%s]:%f", dout, path.distance)
|
|
end
|