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:
MEEPofFaith 2024-09-05 09:27:22 +08:00 committed by GitHub
parent dc956c5b00
commit afc1ff58c5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View File

@ -30,6 +30,7 @@ public class Conveyor extends Block implements Autotiler{
public float speed = 0f;
public float displayedSpeed = 0f;
public boolean pushUnits = true;
public @Nullable Block junctionReplacement, bridgeReplacement;
@ -223,7 +224,7 @@ public class Conveyor extends Block implements Autotiler{
@Override
public void unitOn(Unit unit){
if(clogHeat > 0.5f || !enabled) return;
if(!pushUnits || clogHeat > 0.5f || !enabled) return;
noSleep();

View File

@ -21,6 +21,7 @@ public class PayloadConveyor extends Block{
public @Load("@-edge") TextureRegion edgeRegion;
public Interp interp = Interp.pow5;
public float payloadLimit = 3f;
public boolean pushUnits = true;
public PayloadConveyor(String name){
super(name);
@ -257,7 +258,7 @@ public class PayloadConveyor extends Block{
@Override
public void unitOn(Unit unit){
if(!enabled) return;
if(!pushUnits || !enabled) return;
//calculate derivative of units moved last frame
float delta = (curInterp - lastInterp) * size * tilesize;