Minor ConstructBlock logic tweak
This commit is contained in:
@@ -22,6 +22,8 @@ import mindustry.world.*;
|
||||
import mindustry.world.blocks.storage.CoreBlock.*;
|
||||
import mindustry.world.modules.*;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import static mindustry.Vars.*;
|
||||
|
||||
/** A block in the process of construction. */
|
||||
@@ -263,6 +265,11 @@ public class ConstructBlock extends Block{
|
||||
}
|
||||
|
||||
public void deconstruct(Unit builder, @Nullable Building core, float amount){
|
||||
//reset accumulated resources when switching modes
|
||||
if(wasConstructing){
|
||||
Arrays.fill(accumulator, 0);
|
||||
Arrays.fill(totalAccumulator, 0);
|
||||
}
|
||||
wasConstructing = false;
|
||||
activeDeconstruct = true;
|
||||
float deconstructMultiplier = state.rules.deconstructRefundMultiplier;
|
||||
|
||||
Reference in New Issue
Block a user