Bugfixes
This commit is contained in:
@@ -32,8 +32,10 @@ public class Accelerator extends Block{
|
||||
|
||||
@Override
|
||||
public void init(){
|
||||
itemCapacity = 0;
|
||||
for(ItemStack stack : launching.requirements){
|
||||
capacities[stack.item.id] = stack.amount;
|
||||
itemCapacity += stack.amount;
|
||||
}
|
||||
consumes.items(launching.requirements);
|
||||
super.init();
|
||||
|
||||
@@ -106,6 +106,8 @@ public class StackConveyor extends Block implements Autotiler{
|
||||
public float cooldown;
|
||||
public Item lastItem;
|
||||
|
||||
boolean proxUpdating = false;
|
||||
|
||||
@Override
|
||||
public void draw(){
|
||||
Draw.rect(regions[state], x, y, rotdeg());
|
||||
@@ -168,15 +170,15 @@ public class StackConveyor extends Block implements Autotiler{
|
||||
|
||||
//update other conveyor state when this conveyor's state changes
|
||||
if(state != lastState){
|
||||
proxUpdating = true;
|
||||
for(Building near : proximity){
|
||||
if(near instanceof StackConveyorBuild){
|
||||
if(!(near instanceof StackConveyorBuild b && b.proxUpdating && b.state != stateUnload)){
|
||||
near.onProximityUpdate();
|
||||
for(Building other : near.proximity){
|
||||
if(!(other instanceof StackConveyorBuild)) other.onProximityUpdate();
|
||||
}
|
||||
}
|
||||
}
|
||||
proxUpdating = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -53,12 +53,15 @@ public class UnitFactory extends UnitBlock{
|
||||
@Override
|
||||
public void init(){
|
||||
capacities = new int[Vars.content.items().size];
|
||||
itemCapacity = 0;
|
||||
for(UnitPlan plan : plans){
|
||||
for(ItemStack stack : plan.requirements){
|
||||
capacities[stack.item.id] = Math.max(capacities[stack.item.id], stack.amount * 2);
|
||||
itemCapacity = Math.max(itemCapacity, stack.amount * 2);
|
||||
}
|
||||
}
|
||||
for(int i : capacities){
|
||||
itemCapacity += i;
|
||||
}
|
||||
|
||||
super.init();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user