1
0
Bifurcation 0

This **MAY** resolve the message in issue 312, but this fix ultimately breaks things and will need to eventually be rolled back.

Cette révision appartient à :
Nathanial.C.Jones 2011-02-03 01:49:24 +00:00
Parent bdb8cdc68c
révision 617f265558
3 fichiers modifiés avec 137 ajouts et 120 suppressions

Voir le fichier

@ -131,6 +131,9 @@ local prepared = false
local linktime = 0
function QH_Graph_Pathmultifind(st, nda, reverse, make_path)
QuestHelper: Assert(st.x and st.y and st.p)
if st.p == 26 then return nil end -- DENIED!!!!
--QuestHelper:TextOut("Starting PMF")
QuestHelper: Assert(not active)
QuestHelper: Assert(prepared)
@ -144,8 +147,6 @@ function QH_Graph_Pathmultifind(st, nda, reverse, make_path)
--local stats = QuestHelper:CreateTable("graphcore --stats")
QuestHelper: Assert(st.x and st.y and st.p)
--stats.dests_complex = 0
--stats.dests_total = 0

Voir le fichier

@ -101,12 +101,16 @@ local function GetCachedPath(loc1, loc2)
-- Not in either, time to create
misses = misses + 1
local nrt = QH_Graph_Pathfind(loc1.loc, loc2.loc, false, true)
if nrt then
QuestHelper: Assert(nrt)
if not pathcache_active[loc1] then pathcache_active[loc1] = new_pathcache_table() end
if not pathcache_inactive[loc1] then pathcache_inactive[loc1] = new_pathcache_table() end
pathcache_active[loc1][loc2] = nrt
pathcache_inactive[loc1][loc2] = nrt
return nrt
else
return nil
end
else
hits = hits + 1
if not pathcache_active[loc1] then pathcache_active[loc1] = new_pathcache_table() end
@ -134,6 +138,7 @@ local function ReplotPath(progress)
if last_path[k + 1] then
local nrt = GetCachedPath(last_path[k], last_path[k + 1])
if nrt then
distance = distance + nrt.d
QuestHelper: Assert(nrt)
@ -180,6 +185,7 @@ local function ReplotPath(progress)
if condense_class then condense_doit() end -- in case we have stuff left over
end
end
if progress then progress:SetPercentage(k / #last_path) end
end
@ -371,6 +377,7 @@ Route_Core_Init(
rvv = QuestHelper:CreateTable("route controller path shunt returnvalue")
local rv = QH_Graph_Pathmultifind(loc1.loc, lt, reverse, true)
if rv ~= nil then
QuestHelper: Assert(#lt == #rv, string.format("lt has %d items, rt has %d items. Both should be the same.", #lt, #rv))
-- We want to store the math.max(sqrt(#rv), 10) shortest paths
@ -427,6 +434,9 @@ Route_Core_Init(
QuestHelper:ReleaseTable(rv) -- this had better be releasable
return rvv
else
return nil
end
end
)

Voir le fichier

@ -773,6 +773,7 @@ function QH_Route_Core_Process()
-- Refresh a subset of things.
local forward = DistBatch(NodeList[idx], tlnod)
local backward = DistBatch(NodeList[idx], tlnod, true)
if forward and backward then
for k, v in ipairs(ActiveNodes) do
Distance[idx][v] = forward[k]
@ -785,6 +786,7 @@ function QH_Route_Core_Process()
ctd = ctd + 1
resynch_progress:SetPercentage(ctd / ct)
end
end
QuestHelper:ReleaseTable(tlnod)
end
QuestHelper:ReleaseTable(DistanceWaiting)
@ -1124,6 +1126,7 @@ end
local forward = DistBatch(NodeList[1], tlnod)
if forward then
local ct = 1
for _, v in ipairs(ActiveNodes) do
if v ~= 1 then
@ -1140,6 +1143,7 @@ end
end
QuestHelper:ReleaseTable(forward)
end
QuestHelper:ReleaseTable(tlnod)
Storage_Distance_StoreFromIDToAll(1)
@ -1462,9 +1466,11 @@ function QH_Route_Core_DistanceClear(progress)
for ani, idx in ipairs(ActiveNodes) do
local forward = DistBatch(NodeList[idx], tlnod, false, true)
if forward then
for k, v in ipairs(ActiveNodes) do
Distance[idx][v] = forward[k]
end
end
if QuestHelper.loading_preroll and #ActiveNodes > 1 then QuestHelper.loading_preroll:SetPercentage(ani / #ActiveNodes) end