Fixed #9750
This commit is contained in:
@@ -102,7 +102,7 @@ public class PowerGenerator extends PowerDistributor{
|
||||
|
||||
@Override
|
||||
public float warmup(){
|
||||
return productionEfficiency;
|
||||
return enabled ? productionEfficiency : 0f;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -154,7 +154,7 @@ public class PowerGenerator extends PowerDistributor{
|
||||
|
||||
@Override
|
||||
public float getPowerProduction(){
|
||||
return powerProduction * productionEfficiency;
|
||||
return enabled ? powerProduction * productionEfficiency : 0f;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -88,6 +88,11 @@ public class ThermalGenerator extends PowerGenerator{
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public float totalProgress(){
|
||||
return enabled ? super.totalProgress() : 0f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawLight(){
|
||||
Drawf.light(x, y, (40f + Mathf.absin(10f, 5f)) * Math.min(productionEfficiency, 2f) * size, Color.scarlet, 0.4f);
|
||||
|
||||
@@ -11,11 +11,20 @@ public class PowerSource extends PowerNode{
|
||||
maxNodes = 100;
|
||||
outputsPower = true;
|
||||
consumesPower = false;
|
||||
drawDisabled = true;
|
||||
//TODO maybe don't?
|
||||
envEnabled = Env.any;
|
||||
}
|
||||
|
||||
public class PowerSourceBuild extends PowerNodeBuild{
|
||||
@Override
|
||||
public void onProximityUpdate(){
|
||||
super.onProximityUpdate();
|
||||
if(!allowUpdate()){
|
||||
enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getPowerProduction(){
|
||||
return enabled ? powerProduction : 0f;
|
||||
|
||||
@@ -373,12 +373,12 @@ public class UnitAssembler extends PayloadBlock{
|
||||
units.clear();
|
||||
}
|
||||
|
||||
float powerStatus = power == null ? 1f : power.status;
|
||||
float powerStatus = !enabled ? 0f : power == null ? 1f : power.status;
|
||||
powerWarmup = Mathf.lerpDelta(powerStatus, powerStatus > 0.0001f ? 1f : 0f, 0.1f);
|
||||
droneWarmup = Mathf.lerpDelta(droneWarmup, units.size < dronesCreated ? powerStatus : 0f, 0.1f);
|
||||
totalDroneProgress += droneWarmup * delta();
|
||||
|
||||
if(units.size < dronesCreated && (droneProgress += delta() * state.rules.unitBuildSpeed(team) * powerStatus / droneConstructTime) >= 1f){
|
||||
if(units.size < dronesCreated && enabled && (droneProgress += delta() * state.rules.unitBuildSpeed(team) * powerStatus / droneConstructTime) >= 1f){
|
||||
if(!net.client()){
|
||||
var unit = droneType.create(team);
|
||||
if(unit instanceof BuildingTetherc bt){
|
||||
|
||||
Reference in New Issue
Block a user