Various crashes fixed
This commit is contained in:
@@ -202,6 +202,11 @@ public interface BuilderTrait extends Entity{
|
||||
//otherwise, update it.
|
||||
BuildEntity entity = tile.entity();
|
||||
|
||||
if(entity == null){
|
||||
getPlaceQueue().removeFirst();
|
||||
return;
|
||||
}
|
||||
|
||||
//deconstructing is 2x as fast
|
||||
if(current.remove){
|
||||
entity.deconstruct(unit, core, 2f / entity.buildCost * Timers.delta() * getBuildPower(tile));
|
||||
|
||||
@@ -429,7 +429,7 @@ public class Drone extends FlyingUnit implements BuilderTrait{
|
||||
@Override
|
||||
public void write(DataOutput data) throws IOException{
|
||||
super.write(data);
|
||||
data.writeInt(mineTile == null ? -1 : mineTile.packedPosition());
|
||||
data.writeInt(mineTile == null || !state.is(mine) ? -1 : mineTile.packedPosition());
|
||||
data.writeInt(state.is(repair) && target instanceof TileEntity ? ((TileEntity)target).tile.packedPosition() : -1);
|
||||
writeBuilding(data);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user