Fixed #6174
This commit is contained in:
@@ -158,11 +158,27 @@ public class PayloadDeconstructor extends PayloadBlock{
|
|||||||
|
|
||||||
//finish deconstruction, prepare for next payload.
|
//finish deconstruction, prepare for next payload.
|
||||||
if(progress >= 1f){
|
if(progress >= 1f){
|
||||||
|
canProgress = true;
|
||||||
|
//check for rounding errors
|
||||||
|
for(int i = 0; i < reqs.length; i++){
|
||||||
|
if(Mathf.equal(accum[i], 1f, 0.0001f)){
|
||||||
|
if(items.total() < itemCapacity){
|
||||||
|
items.add(reqs[i].item, 1);
|
||||||
|
accum[i] = 0f;
|
||||||
|
}else{
|
||||||
|
canProgress = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(canProgress){
|
||||||
Fx.breakBlock.at(x, y, deconstructing.size() / tilesize);
|
Fx.breakBlock.at(x, y, deconstructing.size() / tilesize);
|
||||||
|
|
||||||
deconstructing = null;
|
deconstructing = null;
|
||||||
accum = null;
|
accum = null;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}else if(moveInPayload(false) && payload != null){
|
}else if(moveInPayload(false) && payload != null){
|
||||||
accum = new float[payload.requirements().length];
|
accum = new float[payload.requirements().length];
|
||||||
deconstructing = payload;
|
deconstructing = payload;
|
||||||
|
|||||||
Reference in New Issue
Block a user