Fixed a crash

This commit is contained in:
Aidan C. Brady 2015-04-13 08:43:08 -04:00
parent 36a2335350
commit 33f19cf895
2 changed files with 12 additions and 3 deletions

View file

@ -178,14 +178,17 @@ public final class TransporterPathfinder
public Destination calculateScore(World world) public Destination calculateScore(World world)
{ {
score = 0; score = 0;
for(Coord4D location : path) for(Coord4D location : path)
{ {
TileEntity tile = location.getTileEntity(world); TileEntity tile = location.getTileEntity(world);
if(tile instanceof ITransporterTile) if(tile instanceof ITransporterTile)
{ {
score += ((ITransporterTile)tile).getTransmitter().getCost(); score += ((ITransporterTile)tile).getTransmitter().getCost();
} }
} }
return this; return this;
} }
@ -223,9 +226,15 @@ public final class TransporterPathfinder
public static List<Destination> getPaths(ILogisticalTransporter start, TransporterStack stack, int min) public static List<Destination> getPaths(ILogisticalTransporter start, TransporterStack stack, int min)
{ {
InventoryNetwork network = start.getTransmitterNetwork();
List<AcceptorData> acceptors = network.calculateAcceptors(stack.itemStack, stack.color);
List<Destination> paths = new ArrayList<Destination>(); List<Destination> paths = new ArrayList<Destination>();
InventoryNetwork network = start.getTransmitterNetwork();
if(network == null)
{
return paths;
}
List<AcceptorData> acceptors = network.calculateAcceptors(stack.itemStack, stack.color);
for(AcceptorData entry : acceptors) for(AcceptorData entry : acceptors)
{ {

View file

@ -446,6 +446,6 @@ public class PartLogisticalTransporter extends PartTransmitter<IInventory, Inven
public double getCost() public double getCost()
{ {
return 5.D / tier.speed; return 5D / tier.speed;
} }
} }