Lame attempts to improve A*.

This commit is contained in:
James Dunne
2012-07-03 14:54:13 -05:00
committed by Matthias Mailänder
parent 2abde381a7
commit 7e913c4bb7
2 changed files with 9 additions and 7 deletions

View File

@@ -41,7 +41,7 @@ namespace OpenRA.Mods.RA
}
foreach (var p in cellWeights)
layer[p.First.X, p.First.Y] = Math.Min(128, (layer[p.First.X, p.First.Y] / 2) + ((maxWeight - p.Second) * 64 / maxWeight));
layer[p.First.X, p.First.Y] = Math.Min(128, (layer[p.First.X, p.First.Y]) + ((maxWeight - p.Second) * 64 / maxWeight));
}
public void Render(WorldRenderer wr)
@@ -61,6 +61,7 @@ namespace OpenRA.Mods.RA
for (int i = world.Map.Bounds.Left; i <= world.Map.Bounds.Right; ++i)
{
var ploc = new CPos(i, j).ToPPos();
if (layer[i, j] <= 0) continue;
var w = Math.Max(0, Math.Min(layer[i, j], 128));
if (doDim)