Fix NPE on world load when tileBuffer is not yet fully initialized

This commit is contained in:
Krapht 2012-06-29 16:10:07 +02:00
parent 21d5ae99c8
commit 744ef7a25b

View file

@ -28,8 +28,11 @@ public class PipeLiquidsSandstone extends Pipe implements IPipeTransportLiquidsH
@Override
public int fill(Orientations from, int quantity, int id, boolean doFill) {
if (container.tileBuffer == null || container.tileBuffer[from.ordinal()] == null)
return 0;
if (!(container.tileBuffer[from.ordinal()].getTile() instanceof TileGenericPipe))
return 0;
return 0;
return ((PipeTransportLiquids)this.transport).side[from.ordinal()].fill(quantity, doFill, (short) id);
}