function SpawnRandomPickupBases()
{
local float Score[3];
local float eval;
local NavigationPoint Best[3];
local NavigationPoint N;
for(N = Level.NavigationPointList; N != None; N = N.NextNavigationPoint)
{
if(InventorySpot(N) == None || InventorySpot(N).myPickupBase == None)
continue;
eval = FRand() * 5000.0;
if(Best[0] != None)
eval += VSize(Best[0].Location - N.Location) * (FRand() * 4.0 - 2.0);
if(Best[1] != None)
eval += VSize(Best[1].Location - N.Location) * (FRand() * 3.5 - 1.75);
if(Best[2] != None)
eval += VSize(Best[2].Location - N.Location) * (FRand() * 3.0 - 1.5);
if(Best[0] == N)
eval = 0;
if(Best[1] == N)
eval = 0;
if(Best[2] == N)
eval = 0;
if(eval > Score[0])
{
Score[2] = Score[1];
Score[1] = Score[0];
Score[0] = eval;
Best[2] = Best[1];
Best[1] = Best[0];
Best[0] = N;
}
else if(eval > Score[1])
{
Score[2] = Score[1];
Score[1] = eval;
Best[2] = Best[1];
Best[1] = N;
}
else if(eval > Score[2])
{
Score[2] = eval;
Best[2] = N;
}
}
if(Best[0] != None)
{
Bases[0] = Spawn(class'Misc_PickupBase',,, Best[0].Location, Best[0].Rotation);
Bases[0].MyMarker = InventorySpot(Best[0]);
}
if(Best[1] != None)
{
Bases[1] = Spawn(class'Misc_PickupBase',,, Best[1].Location, Best[1].Rotation);
Bases[1].MyMarker = InventorySpot(Best[1]);
}
if(Best[2] != None)
{
Bases[2] = Spawn(class'Misc_PickupBase',,, Best[2].Location, Best[2].Rotation);
Bases[2].MyMarker = InventorySpot(Best[2]);
}
}