Option for conveyors to not push units around (#10166)
* Option to not push units around * Apply to playload conveyors as well
This commit is contained in:
@@ -30,6 +30,7 @@ public class Conveyor extends Block implements Autotiler{
|
|||||||
|
|
||||||
public float speed = 0f;
|
public float speed = 0f;
|
||||||
public float displayedSpeed = 0f;
|
public float displayedSpeed = 0f;
|
||||||
|
public boolean pushUnits = true;
|
||||||
|
|
||||||
public @Nullable Block junctionReplacement, bridgeReplacement;
|
public @Nullable Block junctionReplacement, bridgeReplacement;
|
||||||
|
|
||||||
@@ -223,7 +224,7 @@ public class Conveyor extends Block implements Autotiler{
|
|||||||
@Override
|
@Override
|
||||||
public void unitOn(Unit unit){
|
public void unitOn(Unit unit){
|
||||||
|
|
||||||
if(clogHeat > 0.5f || !enabled) return;
|
if(!pushUnits || clogHeat > 0.5f || !enabled) return;
|
||||||
|
|
||||||
noSleep();
|
noSleep();
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ public class PayloadConveyor extends Block{
|
|||||||
public @Load("@-edge") TextureRegion edgeRegion;
|
public @Load("@-edge") TextureRegion edgeRegion;
|
||||||
public Interp interp = Interp.pow5;
|
public Interp interp = Interp.pow5;
|
||||||
public float payloadLimit = 3f;
|
public float payloadLimit = 3f;
|
||||||
|
public boolean pushUnits = true;
|
||||||
|
|
||||||
public PayloadConveyor(String name){
|
public PayloadConveyor(String name){
|
||||||
super(name);
|
super(name);
|
||||||
@@ -257,7 +258,7 @@ public class PayloadConveyor extends Block{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void unitOn(Unit unit){
|
public void unitOn(Unit unit){
|
||||||
if(!enabled) return;
|
if(!pushUnits || !enabled) return;
|
||||||
|
|
||||||
//calculate derivative of units moved last frame
|
//calculate derivative of units moved last frame
|
||||||
float delta = (curInterp - lastInterp) * size * tilesize;
|
float delta = (curInterp - lastInterp) * size * tilesize;
|
||||||
|
|||||||
Reference in New Issue
Block a user