Fixed an off by one error in CableBusStorage

This will fix #269 and #288
This commit is contained in:
yueh
2014-10-11 12:09:17 +02:00
parent 97758d6f61
commit ae1a7ddc0f
@@ -88,12 +88,12 @@ public class CableBusStorage
private <T> T[] shrink(T[] in, boolean parts)
{
int newSize = 0;
int newSize = -1;
for (int x = 0; x < in.length; x++)
if ( in[x] != null )
newSize = x;
if ( newSize == 0 )
if ( newSize == -1 )
return null;
newSize++;