Merge pull request #210 from AartBluestoke/patch-11

Quary should not use energy when 0 movement would result
This commit is contained in:
SirSengir 2012-09-04 03:09:20 -07:00
commit e1c8d447cc

View file

@ -134,10 +134,13 @@ public class TileQuarry extends TileMachine implements IArmListener, IMachine, I
arm.setArmSpeed(0); arm.setArmSpeed(0);
float energyToUse = 2 + powerProvider.getEnergyStored() / 1000; float energyToUse = 2 + powerProvider.getEnergyStored() / 1000;
float energy = powerProvider.useEnergy(energyToUse, energyToUse, true); boolean enoughStep=(0.015 + energyToUse / 200F)>(1F/32F); // (otherwise the movement is rounded to 0 and the energy absorbed with no movement)
if(enoughStep){
float energy = powerProvider.useEnergy(energyToUse, energyToUse, true);
if (energy > 0) { if (energy > 0) {
arm.doMove(0.015 + energy / 200F); arm.doMove(0.015 + energy / 200F);
}
} }
} }